📄 frmhdset.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmHDSet
BorderStyle = 4 'Fixed ToolWindow
Caption = "硬件参数设置"
ClientHeight = 4155
ClientLeft = 45
ClientTop = 285
ClientWidth = 5940
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 5940
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 375
Left = 4560
TabIndex = 4
Top = 3600
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确 认"
Height = 375
Left = 3360
TabIndex = 3
Top = 3600
Width = 1095
End
Begin TabDlg.SSTab sstForm
Height = 3135
Left = 120
TabIndex = 0
Top = 120
Width = 5655
_ExtentX = 9975
_ExtentY = 5530
_Version = 393216
Style = 1
Tab = 1
TabHeight = 520
TabCaption(0) = "接口类型"
TabPicture(0) = "frmHDSet.frx":0000
Tab(0).ControlEnabled= 0 'False
Tab(0).Control(0)= "optInterface(0)"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "optInterface(1)"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).ControlCount= 2
TabCaption(1) = "RS232/485/422参数"
TabPicture(1) = "frmHDSet.frx":001C
Tab(1).ControlEnabled= -1 'True
Tab(1).Control(0)= "Label1"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).Control(1)= "Label2"
Tab(1).Control(1).Enabled= 0 'False
Tab(1).Control(2)= "Label3"
Tab(1).Control(2).Enabled= 0 'False
Tab(1).Control(3)= "Label4"
Tab(1).Control(3).Enabled= 0 'False
Tab(1).Control(4)= "Label5"
Tab(1).Control(4).Enabled= 0 'False
Tab(1).Control(5)= "Label6"
Tab(1).Control(5).Enabled= 0 'False
Tab(1).Control(6)= "cmbCOMPort"
Tab(1).Control(6).Enabled= 0 'False
Tab(1).Control(7)= "cmbBaudRate"
Tab(1).Control(7).Enabled= 0 'False
Tab(1).Control(8)= "cmbParityMode"
Tab(1).Control(8).Enabled= 0 'False
Tab(1).Control(9)= "cmbDataBit"
Tab(1).Control(9).Enabled= 0 'False
Tab(1).Control(10)= "cmbStopBit"
Tab(1).Control(10).Enabled= 0 'False
Tab(1).Control(11)= "cmbHandShaking"
Tab(1).Control(11).Enabled= 0 'False
Tab(1).Control(12)= "chkEOF"
Tab(1).Control(12).Enabled= 0 'False
Tab(1).Control(13)= "chkNull"
Tab(1).Control(13).Enabled= 0 'False
Tab(1).Control(14)= "chkRTS"
Tab(1).Control(14).Enabled= 0 'False
Tab(1).Control(15)= "chkDTR"
Tab(1).Control(15).Enabled= 0 'False
Tab(1).ControlCount= 16
TabCaption(2) = "以太网参数"
TabPicture(2) = "frmHDSet.frx":0038
Tab(2).ControlEnabled= 0 'False
Tab(2).ControlCount= 0
Begin VB.CheckBox chkDTR
Caption = "DTREnable"
Height = 255
Left = 3120
TabIndex = 20
Top = 2100
Width = 2175
End
Begin VB.CheckBox chkRTS
Caption = "RTSEnable"
Height = 255
Left = 3120
TabIndex = 19
Top = 1740
Width = 2175
End
Begin VB.CheckBox chkNull
Caption = "NullDiscard"
Height = 255
Left = 3120
TabIndex = 18
Top = 1380
Width = 2175
End
Begin VB.CheckBox chkEOF
Caption = "EOFEnable"
Height = 255
Left = 3120
TabIndex = 17
Top = 1020
Width = 2175
End
Begin VB.ComboBox cmbHandShaking
Height = 315
ItemData = "frmHDSet.frx":0054
Left = 1200
List = "frmHDSet.frx":0064
Style = 2 'Dropdown List
TabIndex = 15
Top = 2340
Width = 1455
End
Begin VB.ComboBox cmbStopBit
Height = 315
ItemData = "frmHDSet.frx":0088
Left = 1200
List = "frmHDSet.frx":0095
Style = 2 'Dropdown List
TabIndex = 13
Top = 1980
Width = 1455
End
Begin VB.ComboBox cmbDataBit
Height = 315
ItemData = "frmHDSet.frx":00A4
Left = 1200
List = "frmHDSet.frx":00B7
Style = 2 'Dropdown List
TabIndex = 11
Top = 1620
Width = 1455
End
Begin VB.ComboBox cmbParityMode
Height = 315
ItemData = "frmHDSet.frx":00CA
Left = 1200
List = "frmHDSet.frx":00DD
Style = 2 'Dropdown List
TabIndex = 9
Top = 1260
Width = 1455
End
Begin VB.ComboBox cmbBaudRate
Height = 315
ItemData = "frmHDSet.frx":00FF
Left = 1200
List = "frmHDSet.frx":0139
Style = 2 'Dropdown List
TabIndex = 7
Top = 900
Width = 1455
End
Begin VB.ComboBox cmbCOMPort
Height = 315
ItemData = "frmHDSet.frx":01AA
Left = 1200
List = "frmHDSet.frx":01CC
Style = 2 'Dropdown List
TabIndex = 6
Top = 540
Width = 1455
End
Begin VB.OptionButton optInterface
Caption = "以太网"
Enabled = 0 'False
Height = 255
Index = 1
Left = -74040
TabIndex = 2
Top = 1140
Width = 2415
End
Begin VB.OptionButton optInterface
Caption = "RS232/485/422"
Height = 255
Index = 0
Left = -74040
TabIndex = 1
Top = 780
Value = -1 'True
Width = 2415
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "握手信号"
Height = 195
Left = 240
TabIndex = 16
Top = 2340
Width = 780
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "停止位"
Height = 195
Left = 240
TabIndex = 14
Top = 1980
Width = 585
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "数据位"
Height = 195
Left = 240
TabIndex = 12
Top = 1620
Width = 585
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "校验方式"
Height = 195
Left = 240
TabIndex = 10
Top = 1260
Width = 780
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "波特率"
Height = 195
Left = 240
TabIndex = 8
Top = 900
Width = 585
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "端口"
Height = 195
Left = 240
TabIndex = 5
Top = 540
Width = 390
End
End
End
Attribute VB_Name = "frmHDSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If optInterface(0).Value = True Then
gtHDSet.byInterfaceType = 0
Else
gtHDSet.byInterfaceType = 1
End If
gtHDSet.byCOMPort = cmbCOMPort.ListIndex + 1
gtHDSet.byBaudRate = cmbBaudRate.ListIndex
gtHDSet.byParityMode = cmbParityMode.ListIndex
gtHDSet.byDataBit = cmbDataBit.ListIndex
gtHDSet.byStopBit = cmbStopBit.ListIndex
gtHDSet.byHandShaking = cmbHandShaking.ListIndex
gtHDSet.bEOFEnable = -chkEOF.Value
gtHDSet.bNullDiscard = -chkNull.Value
gtHDSet.bRTSEnable = -chkRTS.Value
gtHDSet.bDTREnable = -chkDTR.Value
Call gsubSaveINI
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
optInterface(gtHDSet.byInterfaceType).Value = True
For i = 1 To 2
sstForm.TabEnabled(i) = False
Next i
sstForm.TabEnabled(gtHDSet.byInterfaceType + 1) = True
cmbCOMPort.ListIndex = gtHDSet.byCOMPort - 1
cmbBaudRate.ListIndex = gtHDSet.byBaudRate
cmbParityMode.ListIndex = gtHDSet.byParityMode
cmbDataBit.ListIndex = gtHDSet.byDataBit
cmbStopBit.ListIndex = gtHDSet.byStopBit
cmbHandShaking.ListIndex = gtHDSet.byHandShaking
chkEOF.Value = -gtHDSet.bEOFEnable
chkNull.Value = -gtHDSet.bNullDiscard
chkRTS.Value = -gtHDSet.bRTSEnable
chkDTR.Value = -gtHDSet.bDTREnable
End Sub
Private Sub optInterface_Click(Index As Integer)
Dim i As Integer
For i = 1 To 2
sstForm.TabEnabled(i) = False
Next i
sstForm.TabEnabled(Index + 1) = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -