展开全部
Dim nodx As Node
Private Sub Command1_Click()
ImageList1.ListImages.Add 1, "a1", LoadPicture("d:\1.gif")
ImageList1.ListImages.Add 2, "a2", LoadPicture("d:\2.jpg")
'Picture1.Picture = ImageList1
TreeView1.ImageList = ImageList1
'树状外观包含全部元素
Set nodx = TreeView1.Nodes.Add(, , "a", "a", 1)
'建立名称为"a"的父节点,选择索引为1的图像
Set nodx = TreeView1.Nodes.Add("a", tvwChild, "child01", "b", 2)
'在"a"父节点下建立"b"子节点,选择索引为2的图像
Set nodx = TreeView1.Nodes.Add("a", tvwChild, "child02", "b1", 2) '在"a"父节点下建立"b1"子节点,选择索引为2的图像
End Sub
Private Sub Command1_Click()
ImageList1.ListImages.Add 1, "a1", LoadPicture("d:\1.gif")
ImageList1.ListImages.Add 2, "a2", LoadPicture("d:\2.jpg")
'Picture1.Picture = ImageList1
TreeView1.ImageList = ImageList1
'树状外观包含全部元素
Set nodx = TreeView1.Nodes.Add(, , "a", "a", 1)
'建立名称为"a"的父节点,选择索引为1的图像
Set nodx = TreeView1.Nodes.Add("a", tvwChild, "child01", "b", 2)
'在"a"父节点下建立"b"子节点,选择索引为2的图像
Set nodx = TreeView1.Nodes.Add("a", tvwChild, "child02", "b1", 2) '在"a"父节点下建立"b1"子节点,选择索引为2的图像
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询