Office中国论坛/Access中国论坛
标题:
关于控件树
[打印本页]
作者:
GEEEK
时间:
2021-4-9 23:52
标题:
关于控件树
Option Compare Database
Dim WithEvents TreeView0 As TreeView
Private Sub Form_Load()
'创建树============================================================
Set TreeView0 = New TreeView
TreeView0.Create Me.Box0, Me.Command1, tvwTreelinesPlusMinusPictureText, tvwRootlines, IconSmall, tsWinVista
'树节点============================================================
TreeView0.Nodes.Add , , "a0", "送检", 1
TreeView0.Nodes.Add , , "b0", "检测", 1
TreeView0.Nodes.Add , , "c0", "统计", 1
TreeView0.Nodes.Add , , "d0", "个人设置", 4
TreeView0.Nodes.Add , , "e0", "管理员", 4
TreeView0.Nodes.Add , , "f0", "注销", 6
TreeView0.Nodes.Add "a0", tvwChild, "a01", "送检登记", 2
TreeView0.Nodes.Add "a0", tvwChild, "a02", "送检查询", 2
TreeView0.Nodes.Add "b0", tvwChild, "b01", "待检测", 2
TreeView0.Nodes.Add "b0", tvwChild, "b02", "已检测", 2
'TreeView0.Nodes.Add "a01", tvwChild, "a011", "待添加"
'树图标=============================================================
TreeView0.AddImage "E:\Access+VBA\工作\图标\b.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\c.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\d.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\e.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\f.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\g.png", 16, 16, -1
TreeView0.AddImage "E:\Access+VBA\工作\图标\tp.jpeg", 50, 50, -1
'TreeView0.Nodes("送样登记").Expanded = True ' 展开指定节点
'树属性=============================================================
'字体
With TreeView0.Font
.Name = "宋体"
.Bold = False
.Size = 10
End With
'背景色
TreeView0.BackColor = 15790320
'3D效果
TreeView0.Appearance = 1
'字体颜色
TreeView0.TextColor = 0
'树分支间距
TreeView0.ItemHeight = 350
'缩进
TreeView0.Indentation = 150
End Sub
'窗体卸载
Private Sub Form_Unload(Cancel As Integer)
Set TreeView0 = Nothing
End Sub
'Private Sub TreeView0_NodeClick(ByVal Node As Node)
' With Node
' Me.TX = .FullPath
' End With
'End Sub
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3