📄 frmcomset.frm
字号:
VERSION 5.00
Begin VB.Form frmCOMset
BorderStyle = 3 'Fixed Dialog
Caption = "通信端口设置"
ClientHeight = 4065
ClientLeft = 6795
ClientTop = 4320
ClientWidth = 2865
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4065
ScaleWidth = 2865
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Caption = "变频器通讯端口设置"
Height = 3375
Left = 120
TabIndex = 2
Top = 120
Width = 2655
Begin VB.ComboBox Combo6
Height = 300
Left = 960
TabIndex = 14
Text = "Combo6"
Top = 1320
Width = 1575
End
Begin VB.ComboBox Combo5
Height = 300
Left = 960
TabIndex = 12
Text = "Combo5"
Top = 2760
Width = 1575
End
Begin VB.ComboBox Combo4
Height = 300
Left = 960
TabIndex = 11
Text = "Combo4"
Top = 2280
Width = 1575
End
Begin VB.ComboBox Combo3
Height = 300
Left = 960
TabIndex = 8
Text = "Combo3"
Top = 1800
Width = 1575
End
Begin VB.ComboBox Combo2
Height = 300
Left = 960
TabIndex = 6
Text = "Combo2"
Top = 840
Width = 1575
End
Begin VB.ComboBox Combo1
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 4
Top = 360
Width = 1575
End
Begin VB.Label Label1
Caption = "数据位"
Height = 255
Index = 5
Left = 120
TabIndex = 13
Top = 1320
Width = 615
End
Begin VB.Label Label1
Caption = "控制流"
Height = 255
Index = 4
Left = 120
TabIndex = 10
Top = 2760
Width = 615
End
Begin VB.Label Label1
Caption = "停止位"
Height = 255
Index = 3
Left = 120
TabIndex = 9
Top = 2280
Width = 615
End
Begin VB.Label Label1
Caption = "奇偶校验"
Height = 255
Index = 2
Left = 120
TabIndex = 7
Top = 1800
Width = 735
End
Begin VB.Label Label1
Caption = "波特率"
Height = 255
Index = 1
Left = 120
TabIndex = 5
Top = 840
Width = 615
End
Begin VB.Label Label1
Caption = "端口"
Height = 255
Index = 0
Left = 120
TabIndex = 3
Top = 360
Width = 495
End
End
Begin VB.CommandButton cmdCancel
Caption = "取消&C"
Height = 375
Left = 1560
TabIndex = 1
Top = 3600
Width = 1200
End
Begin VB.CommandButton cmdOK
Caption = "确定&O"
Height = 375
Left = 120
TabIndex = 0
Top = 3600
Width = 1200
End
End
Attribute VB_Name = "frmCOMset"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
strSetting = Combo2.Text & ","
MscomPort = Combo1.ListIndex + 1
Select Case Combo3.ListIndex
Case 0
strSetting = strSetting & "n," & Combo6.Text & "," & Combo4.Text
Case 1
strSetting = strSetting & "m," & Combo6.Text & "," & Combo4.Text
Case 2
strSetting = strSetting & "o," & Combo6.Text & "," & Combo4.Text
End Select
OpenFlag = True
' tran.SetComm Combo1.ListIndex + 3, 1, strSetting
' WritePrivateProfileString "Tran", "COM", CStr(Combo1.ListIndex + 3), iniPaths + "system.ini"
' WritePrivateProfileString "Tran", "setting", strSetting, iniPaths + "system.ini"
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim RetVal As Long
' RetVal = SetParent(Me.hWnd, Transducer.hWnd)
Combo1.AddItem "COM1", 0
Combo1.AddItem "COM2", 1
Combo1.AddItem "COM3", 2
Combo1.AddItem "COM4", 3
Combo1.ListIndex = 1
Combo2.AddItem "2400", 0
Combo2.AddItem "7200", 1
Combo2.AddItem "9600", 2
Combo2.AddItem "14400", 3
Combo2.AddItem "19200", 4
Combo2.AddItem "384000", 5
Combo2.AddItem "576000", 6
Combo2.ListIndex = 2
Combo6.AddItem "4", 0
Combo6.AddItem "5", 1
Combo6.AddItem "6", 2
Combo6.AddItem "7", 3
Combo6.AddItem "8", 4
Combo6.ListIndex = 4
Combo3.AddItem "无", 0
Combo3.AddItem "奇", 1
Combo3.AddItem "偶", 2
Combo3.ListIndex = 0
Combo4.AddItem "1", 0
Combo4.AddItem "2", 1
Combo4.ListIndex = 1
Combo5.AddItem "Xon/Xoff", 0
Combo5.AddItem "无", 1
Combo5.ListIndex = 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -