1,451
社区成员
发帖
与我相关
我的任务
分享
Private Sub Form_Load()
TreeView1.HideSelection = True
TreeView1.Indentation = 19 * Screen.TwipsPerPixelX '缩进距离
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
Dim Node1 As Node, Node2 As Node
Dim dzd_tmp1 As String '大节点
Dim xzd_tmp1 As String '小节点
Dim i As Integer, j As Integer
For i = 1 To 5
DoEvents
dzd_tmp1 = "xx" & i
Set Node1 = TreeView1.Nodes.Add(, , , dzd_tmp1) '添加大节点
For j = 1 To 5
DoEvents
xzd_tmp1 = "y" & j
Set Node2 = TreeView1.Nodes.Add(Node1.Index, _
tvwChild, , xzd_tmp1) '添加小节点
Next
Node1.Expanded = True '展开所有节点
Next
End Sub