📄 form1.frm
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7095
ClientLeft = 60
ClientTop = 450
ClientWidth = 7890
LinkTopic = "Form1"
ScaleHeight = 7095
ScaleWidth = 7890
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command5
Caption = "Send"
Height = 375
Left = 2520
TabIndex = 12
Top = 3960
Width = 735
End
Begin VB.ComboBox Combo2
Height = 315
ItemData = "Form1.frx":0000
Left = 600
List = "Form1.frx":0010
Style = 2 'Dropdown List
TabIndex = 11
Top = 5160
Width = 1215
End
Begin VB.TextBox Text6
Height = 3735
Left = 2520
MultiLine = -1 'True
TabIndex = 10
Text = "Form1.frx":0030
Top = 120
Width = 735
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 9
Top = 5040
Width = 855
End
Begin VB.TextBox Text4
Height = 375
Left = 2160
MaxLength = 1
TabIndex = 8
Top = 4560
Width = 855
End
Begin VB.CommandButton Command4
Caption = "Open"
Height = 375
Left = 600
TabIndex = 7
Top = 5640
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 315
ItemData = "Form1.frx":0036
Left = 600
List = "Form1.frx":0052
Style = 2 'Dropdown List
TabIndex = 6
Top = 4800
Width = 1215
End
Begin VB.TextBox Text3
Height = 3735
Left = 5760
MultiLine = -1 'True
TabIndex = 5
Top = 120
Width = 1935
End
Begin VB.CommandButton Command3
Caption = "Clear"
Height = 375
Left = 4320
TabIndex = 4
Top = 3960
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "Poll"
Height = 375
Left = 960
TabIndex = 3
Top = 3960
Width = 735
End
Begin VB.CommandButton Command1
Caption = "Send"
Height = 375
Left = 120
TabIndex = 2
Top = 3960
Width = 735
End
Begin VB.TextBox Text2
Height = 3735
Left = 3720
MultiLine = -1 'True
TabIndex = 1
Top = 120
Width = 1935
End
Begin VB.TextBox Text1
Height = 3735
Left = 120
MultiLine = -1 'True
TabIndex = 0
Text = "Form1.frx":0086
Top = 120
Width = 2295
End
Begin MSCommLib.MSComm ClockComm
Left = 2520
Top = 5040
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
CommPort = 2
DTREnable = -1 'True
InBufferSize = 32500
RThreshold = 1
BaudRate = 19200
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ClockComm_OnComm()
Dim Tex As String
Tex = ClockComm.Input
If Tex = "" Then Exit Sub
Text3.Text = Text3.Text + "-" + Str(Asc(Tex))
Text2.Text = Text2.Text + (Tex)
End Sub
Private Sub Command1_Click()
ClockComm.Output = Text1.Text + Chr(13)
End Sub
Private Sub Command2_Click()
ClockComm.Output = Chr(1) + Chr(3)
End Sub
Private Sub Command3_Click()
Text3.Text = ""
Text2.Text = ""
End Sub
Private Sub Command4_Click()
Call Update_ComPort(ClockComm, Combo1.ListIndex + 1, Combo2.Text)
End Sub
Private Sub Command5_Click()
ClockComm.Output = Text6.Text
End Sub
Private Sub Form_Load()
Combo1.ListIndex = 0
Combo1.ListIndex = 1
Call Update_ComPort(ClockComm, 1, "19200")
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
Text5.Text = Str(KeyCode)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -