📄 frmtree.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmtree
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 9465
ClientLeft = 0
ClientTop = 0
ClientWidth = 2550
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 9465
ScaleWidth = 2550
ShowInTaskbar = 0 'False
Begin VB.PictureBox Picture1
Height = 255
Index = 5
Left = 1800
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 11
Top = 8520
Width = 135
End
Begin VB.PictureBox Picture1
Height = 255
Index = 4
Left = 1680
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 10
Top = 8520
Width = 135
End
Begin VB.PictureBox Picture1
Height = 255
Index = 3
Left = 1560
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 9
Top = 8520
Width = 135
End
Begin VB.PictureBox Picture1
Height = 255
Index = 2
Left = 1440
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 8
Top = 8520
Width = 135
End
Begin VB.PictureBox Picture1
Height = 255
Index = 1
Left = 1320
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 7
Top = 8520
Width = 135
End
Begin VB.PictureBox Picture1
Height = 255
Index = 0
Left = 1200
ScaleHeight = 195
ScaleWidth = 75
TabIndex = 6
Top = 8520
Width = 135
End
Begin MSComctlLib.ImageList ImageList1
Left = 960
Top = 3720
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":0E52
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":10C0
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":133C
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":158B
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmtree.frx":280D
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 2415
Left = 360
TabIndex = 0
Top = 360
Width = 1755
_ExtentX = 3096
_ExtentY = 4260
_Version = 393217
Style = 7
Appearance = 1
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "单机通讯"
Height = 180
Left = 540
TabIndex = 18
Top = 8880
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "主动上传"
Height = 180
Left = 1320
TabIndex = 17
Top = 7860
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "通信方式:"
Height = 180
Left = 240
TabIndex = 16
Top = 7860
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "单机FLPS规约"
Height = 180
Left = 1200
TabIndex = 15
Top = 7560
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "通信规约:"
Height = 180
Left = 240
TabIndex = 14
Top = 7560
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Height = 180
Left = 1200
TabIndex = 13
Top = 6900
Width = 90
End
Begin VB.Label Label6
Caption = "设备地址:"
Height = 180
Left = 240
TabIndex = 12
Top = 6900
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "发送状态:"
Height = 180
Left = 240
TabIndex = 5
Top = 8520
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "打开"
Height = 180
Left = 1200
TabIndex = 4
Top = 8160
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "串口状态:"
Height = 180
Left = 240
TabIndex = 3
Top = 8160
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Height = 180
Left = 1200
TabIndex = 2
Top = 7260
Width = 90
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "设备类型:"
Height = 180
Left = 240
TabIndex = 1
Top = 7260
Width = 900
End
End
Attribute VB_Name = "frmtree"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
TreeWidth = 2500
TreeHeight = fMainForm.ScaleHeight
frmtree.Left = 0
frmtree.Top = 0
frmtree.Width = TreeWidth
frmtree.Height = TreeHeight
With TreeView1
.Left = 50
.Top = 50
.Width = frmtree.ScaleWidth - .Left * 2
.Height = frmtree.ScaleHeight - .Top * 2
.Height = 6800
End With
SetTree
Label2.Caption = ""
Label4.Caption = "COM" & ComPort
frmtree.Label11.Caption = "主动通信方式"
End Sub
Private Sub SetTree()
Dim Node As Node
Dim i As Integer
With TreeView1
.ImageList = ImageList1
.LineStyle = 1
.Indentation = 150
.Style = 7
.LabelEdit = tvwManual
.HotTracking = False
.Nodes.Add , , "main", "请进行选择", 3 '根节点
.Nodes.Add , , "quit", "退出系统", 2
For i = 1 To Device_num
.Nodes.Add "main", tvwChild, "ID" & i, "ID" & Dev_Addr(i) & "," & dev_type(i), 4
Next i
For i = 1 To TreeView1.Nodes.Count
.Nodes(i).Expanded = True
Next i
End With
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Dim temp As String
Select Case Node.Text
Case "请进行选择"
Case "退出系统"
Unload fMainForm
Case Else
temp = Node.Text
Dim i As Integer
i = InStr(1, temp, ",")
Select_ID = Mid(temp, i + 1, Len(temp) - i)
Device_Addr = Mid(temp, 3, i - 2)
temp = Node.Key
Cur_Dev.addr = Device_Addr
Cur_Dev.dev_type = Select_ID
Cur_Dev.dev_key = Mid(temp, 3)
'Device_Addr = Node.Key
Label2.Caption = Select_ID
Label7.Caption = Device_Addr
With Form1
' .GetListData (Select_ID)
' .GetPara (Select_ID)
.Set_Para_Name
.Set_CurTm_Dat
.Set_Para
' .SSTab1(0).Tab = 5
' .MGButton1.Enabled = True
' .MGButton2.Enabled = True
' .MGButton3.Enabled = True
' .MGButton4.Enabled = True
.SSTab1(0).Enabled = True
End With
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -