?? main.frm
字號:
VERSION 5.00
Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0"; "COMCT232.OCX"
Begin VB.Form Main
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "倉庫參數配置"
ClientHeight = 2505
ClientLeft = 45
ClientTop = 330
ClientWidth = 6885
Icon = "Main.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 6885
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "放棄返回(&C)"
Height = 420
Left = 5190
TabIndex = 3
Top = 765
Width = 1440
End
Begin VB.CommandButton Command1
Caption = "保存設置(S)"
Enabled = 0 'False
Height = 420
Left = 5190
TabIndex = 2
Top = 285
Width = 1440
End
Begin VB.Frame Frame1
Caption = "報警數量"
Height = 1890
Left = 300
TabIndex = 4
Top = 270
Width = 2250
Begin VB.CheckBox Check1
Caption = "啟動時顯示"
Height = 330
Left = 390
TabIndex = 1
Top = 1395
Width = 1365
End
Begin ComCtl2.UpDown UpDown1
Height = 315
Left = 1410
TabIndex = 6
Top = 885
Width = 270
_ExtentX = 476
_ExtentY = 556
_Version = 327681
Value = 1000
AutoBuddy = -1 'True
BuddyControl = "Text1"
BuddyDispid = 196613
OrigLeft = 1695
OrigTop = 915
OrigRight = 1965
OrigBottom = 1245
Increment = 10
Max = 20000
Min = 10
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin VB.TextBox Text1
Height = 285
Left = 405
MaxLength = 5
TabIndex = 0
Text = "10"
Top = 900
Width = 1050
End
Begin VB.Label Label1
Caption = "當產品數量低于下面數量時,自動報警!"
ForeColor = &H00808000&
Height = 570
Left = 390
TabIndex = 5
Top = 360
Width = 1665
End
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = -1065
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = -300
Width = 1140
End
Begin VB.Image Image1
Height = 1845
Left = 2685
Picture = "Main.frx":08CA
Stretch = -1 'True
Top = 210
Width = 2145
End
End
Attribute VB_Name = "Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo NoValible
Dim InNum As Integer, TempFile As String, TempStr As String
TempFile = Browser + "ALERT.YSL"
InNum = FreeFile
Open TempFile For Output As #InNum
TempStr = Text1.Text
Print #InNum, TempStr
If Check1.Value = 0 Then
TempStr = "啟動時不顯示"
Else
TempStr = "啟動時顯示"
End If
Print #InNum, TempStr
Close #InNum
Unload Me
Exit Sub
NoValible:
MsgBox "報警配置文件沒有找到!", vbOKOnly + 16, "警告!"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Main.Left = (MDIForm1.Width - Main.Width) / 2
Main.Top = (MDIForm1.Height - Main.Height) / 2 - 1000
On Error GoTo NoValible
Dim InNum As Integer, TempFile As String, TempStr As String
TempFile = Browser + "ALERT.YSL"
InNum = FreeFile
Open TempFile For Input As #InNum
Line Input #InNum, TempStr
Line Input #InNum, TempFile
Close #InNum
Text1.Text = Trim(TempStr)
If Trim(TempFile) = "啟動時顯示" Then
Check1.Value = Checked
Else
Check1.Value = 0
End If
Exit Sub
NoValible:
MsgBox "報警配置文件沒有找到!", vbOKOnly + 16, "警告!"
End Sub
Private Sub Text1_Change()
If Val(Text1.Text) > 0 Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If NumberTrue(KeyAscii, Text1) = False Then
KeyAscii = 0
End If
End Sub
Function NumberTrue(keyNumber As Integer, NumberStr As TextBox) As Boolean
'轉入退格鍵時
If keyNumber = 8 Then
If Len(Trim(NumberStr.Text)) > 0 Then
Dim Tstr As String
Tstr = Left(NumberStr.Text, Len(NumberStr.Text) - 1)
NumberStr.SelLength = 0
NumberStr.SelStart = Len(Trim(Tstr)) + 1
NumberTrue = True
Exit Function
End If
End If
If keyNumber >= 48 And keyNumber <= 57 Then
NumberTrue = True
Else
NumberTrue = False
End If
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -