- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form main_datatree
- BorderStyle = 3 'Fixed Dialog
- Caption = "部门信息"
- ClientHeight = 3195
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 3300
- Icon = "main_datatree.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3195
- ScaleWidth = 3300
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin MSComctlLib.ImageList ImageList1
- Left = 645
- Top = 825
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 9
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":000C
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":08E6
- Key = ""
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":11C0
- Key = ""
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":14DA
- Key = ""
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":17F4
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":20CE
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":29A8
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":2CC2
- Key = ""
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_datatree.frx":2FDC
- Key = ""
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.TreeView TreeView1
- Height = 3180
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 3300
- _ExtentX = 5821
- _ExtentY = 5609
- _Version = 393217
- HideSelection = 0 'False
- Indentation = 617
- LabelEdit = 1
- LineStyle = 1
- Sorted = -1 'True
- Style = 6
- Appearance = 1
- OLEDragMode = 1
- End
- End
- Attribute VB_Name = "main_datatree"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim rs1 As New ADODB.Recordset
- Private Sub Form_Load()
- Dim mNode As Node
- rs1.Open "select * from 部门表 order by 部门编号,编码级次", Cnn, adOpenKeyset, adLockOptimistic
- If rs1.RecordCount > 0 Then
- rs1.MoveFirst
- Do While rs1.EOF = False
- Select Case rs1.Fields("编码级次")
- Case 1
- Set mNode = TreeView1.Nodes.Add()
- mNode.text = "(" & rs1.Fields("本级编号") & ")" & rs1.Fields("部门名称")
- mNode.Key = rs1.Fields("部门全称")
- Case 2
- Set mNode1 = TreeView1.Nodes.Add(mNode.index, tvwChild)
- mNode1.text = "(" & rs1.Fields("本级编号") & ")" & rs1.Fields("部门名称")
- mNode1.Key = rs1.Fields("部门全称")
- Case 3
- Set mNode2 = TreeView1.Nodes.Add(mNode1.index, tvwChild)
- mNode2.text = "(" & rs1.Fields("本级编号") & ")" & rs1.Fields("部门名称")
- mNode2.Key = rs1.Fields("部门全称")
- Case 4
- Set mNode3 = TreeView1.Nodes.Add(mNode2.index, tvwChild)
- mNode3.text = "(" & rs1.Fields("本级编号") & ")" & rs1.Fields("部门名称")
- mNode3.Key = rs1.Fields("部门全称")
- Case 5
- Set mNode4 = TreeView1.Nodes.Add(mNode3.index, tvwChild)
- mNode4.text = "(" & rs1.Fields("本级编号") & ")" & rs1.Fields("部门名称")
- mNode4.Key = rs1.Fields("部门全称")
- End Select
- rs1.MoveNext
- Loop
- End If
- rs1.Close
- End Sub
- Private Sub TreeView1_KeyDown(KeyCode As Integer, Shift As Integer)
- Select Case deptMark
- Case 1
- If KeyCode = vbKeyReturn Then
- main_rsgl_rsbd_lr.Txt1 = TreeView1.SelectedItem.Key
- Unload Me
- End If
- Case 2
- If KeyCode = vbKeyReturn Then
- main_rsgl_rsdaxx_lr.Txt1(11) = TreeView1.SelectedItem.Key
- Unload Me
- End If
- End Select
- End Sub