📄 4.frm
字号:
VERSION 5.00
Begin VB.Form WAIT
Caption = "Form4"
ClientHeight = 2295
ClientLeft = 3060
ClientTop = 3840
ClientWidth = 4680
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form4"
ScaleHeight = 2295
ScaleWidth = 4680
Begin VB.CommandButton Command2
Caption = "End"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 4
Top = 1680
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 3
Top = 1680
Width = 975
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 2880
TabIndex = 1
Text = "1"
Top = 360
Width = 495
End
Begin VB.Image Image1
Height = 480
Left = 120
Picture = "4.frx":0000
Top = 240
Width = 480
End
Begin VB.Label Label3
Caption = "Label3"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 375
Left = 840
TabIndex = 5
Top = 1080
Width = 3135
End
Begin VB.Label Label2
Caption = "分钟"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3480
TabIndex = 2
Top = 360
Width = 615
End
Begin VB.Label Label1
Caption = "请输入等待的时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 0
Top = 360
Width = 2175
End
End
Attribute VB_Name = "WAIT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim outData1(1 To 1) As Byte
Dim outData2(1 To 1) As Byte
Dim inData() As Byte
Dim dstart%
outData1(1) = 74
outData2(1) = Text1.Text
'TX.MSComm1.PortOpen = True
TX.MSComm1.Output = outData1
Do
DoEvents
Loop Until TX.MSComm1.InBufferCount >= 1
inData = TX.MSComm1.Input
dstart = LBound(inData)
If inData(dstart) = 75 Then
GoTo 1:
Else
Label3.Caption = "通信有误,最好重新设置"
End If
1:
TX.MSComm1.Output = outData2
Do
DoEvents
Loop Until TX.MSComm1.InBufferCount >= 1
inData = TX.MSComm1.Input
dstart = LBound(inData)
If inData(dstart) = Text1.Text Then
Command2.Enabled = True
Label3.Caption = "所有设置工作已完成,你可以退出此程序"
Command2.Caption = "完成"
Else
Label3.Caption = "等待时间设置有误"
End If
End Sub
Private Sub Command2_Click()
TX.MSComm1.PortOpen = False
End
End Sub
Private Sub Form_Load()
Command2.Enabled = False
Label3.Caption = "注:您可以输入的值必须小于255!"
TX.MSComm1.PortOpen = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -