设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1903|回复: 0
打印 上一主题 下一主题

关于控件树

[复制链接]

点击这里给我发消息

跳转到指定楼层
1#
发表于 2021-4-9 23:52:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-25 17:22 , Processed in 0.097000 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表