是什么意思?
我要如何初始化???
3 个解决方案
#1
set Listview1.ListItems = ImageList1
#2
Option Explicit
Private Sub Form_Load()
Dim Node1 As Node
Dim Node2 As Node
Dim Node3 As Node
Dim i As Integer
Dim j As Integer
Dim k As Integer
' For some convenience...
TreeView1.HideSelection = False
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
' Fill up the treeview...
For i = 1 To 2
Set Node1 = TreeView1.Nodes.Add(, , , "根目录" & i, 1)
For j = 1 To 3
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, , "子目录" & i & "-" & j, 2)
For k = 1 To 3
Set Node3 = TreeView1.Nodes.Add(Node2.Index, tvwChild, , "二级子目录" & (16 * (i - 1)) + (4 * (j - 1)) + k, 3)
Next
Next
Node1.Expanded = True
Next
' Set the labels with the first root Node's text.
' (a NodeClick event is not generated even though the first
' node in the TV is selected when the TV first appears).
End Sub
(我真的不明白,里面有treeview,imagelist两个控件。)
可是我把人家的源代码就能编译通过,我把源代码复制过来,但不能通过编译。
它提示“在imagelist可以使用之前必须将它初始化”
有谁告诉我是怎么回事,要怎么弄呀?
Private Sub Form_Load()
Dim Node1 As Node
Dim Node2 As Node
Dim Node3 As Node
Dim i As Integer
Dim j As Integer
Dim k As Integer
' For some convenience...
TreeView1.HideSelection = False
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
' Fill up the treeview...
For i = 1 To 2
Set Node1 = TreeView1.Nodes.Add(, , , "根目录" & i, 1)
For j = 1 To 3
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, , "子目录" & i & "-" & j, 2)
For k = 1 To 3
Set Node3 = TreeView1.Nodes.Add(Node2.Index, tvwChild, , "二级子目录" & (16 * (i - 1)) + (4 * (j - 1)) + k, 3)
Next
Next
Node1.Expanded = True
Next
' Set the labels with the first root Node's text.
' (a NodeClick event is not generated even though the first
' node in the TV is selected when the TV first appears).
End Sub
(我真的不明白,里面有treeview,imagelist两个控件。)
可是我把人家的源代码就能编译通过,我把源代码复制过来,但不能通过编译。
它提示“在imagelist可以使用之前必须将它初始化”
有谁告诉我是怎么回事,要怎么弄呀?
#3
set TreeView1.ListItems = ImageList1
你打开TREEVIEW控件的属性看看!
你打开TREEVIEW控件的属性看看!
#1
set Listview1.ListItems = ImageList1
#2
Option Explicit
Private Sub Form_Load()
Dim Node1 As Node
Dim Node2 As Node
Dim Node3 As Node
Dim i As Integer
Dim j As Integer
Dim k As Integer
' For some convenience...
TreeView1.HideSelection = False
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
' Fill up the treeview...
For i = 1 To 2
Set Node1 = TreeView1.Nodes.Add(, , , "根目录" & i, 1)
For j = 1 To 3
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, , "子目录" & i & "-" & j, 2)
For k = 1 To 3
Set Node3 = TreeView1.Nodes.Add(Node2.Index, tvwChild, , "二级子目录" & (16 * (i - 1)) + (4 * (j - 1)) + k, 3)
Next
Next
Node1.Expanded = True
Next
' Set the labels with the first root Node's text.
' (a NodeClick event is not generated even though the first
' node in the TV is selected when the TV first appears).
End Sub
(我真的不明白,里面有treeview,imagelist两个控件。)
可是我把人家的源代码就能编译通过,我把源代码复制过来,但不能通过编译。
它提示“在imagelist可以使用之前必须将它初始化”
有谁告诉我是怎么回事,要怎么弄呀?
Private Sub Form_Load()
Dim Node1 As Node
Dim Node2 As Node
Dim Node3 As Node
Dim i As Integer
Dim j As Integer
Dim k As Integer
' For some convenience...
TreeView1.HideSelection = False
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
' Fill up the treeview...
For i = 1 To 2
Set Node1 = TreeView1.Nodes.Add(, , , "根目录" & i, 1)
For j = 1 To 3
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, , "子目录" & i & "-" & j, 2)
For k = 1 To 3
Set Node3 = TreeView1.Nodes.Add(Node2.Index, tvwChild, , "二级子目录" & (16 * (i - 1)) + (4 * (j - 1)) + k, 3)
Next
Next
Node1.Expanded = True
Next
' Set the labels with the first root Node's text.
' (a NodeClick event is not generated even though the first
' node in the TV is selected when the TV first appears).
End Sub
(我真的不明白,里面有treeview,imagelist两个控件。)
可是我把人家的源代码就能编译通过,我把源代码复制过来,但不能通过编译。
它提示“在imagelist可以使用之前必须将它初始化”
有谁告诉我是怎么回事,要怎么弄呀?
#3
set TreeView1.ListItems = ImageList1
你打开TREEVIEW控件的属性看看!
你打开TREEVIEW控件的属性看看!