永发信息网

VB treeview详解

答案:2  悬赏:0  手机版
解决时间 2021-02-15 13:32
  • 提问者网友:你挡着我发光了
  • 2021-02-14 14:48
怎么设置treenode?
最佳答案
  • 五星知识达人网友:旧脸谱
  • 2021-02-14 15:53
'新建一个窗体,上面放一个TreeView和一个ListView,一个ListImage
'ListImage控件要添加8张以上一样大小的icon文件
'TreeView1和ListView的图像列表都设置成ListImage1
Private Sub Form_Load()
TreeView1.Style = tvwTreelinesPlusMinusPictureText
TreeView1.LabelEdit = tvwManual
TreeView1.Checkboxes = True
ListView1.View = lvwIcon
ListView1.BorderStyle = ccFixedSingle

TreeView1.Nodes.Add , , "r", "学籍管理信息系统", 1
TreeView1.Nodes.Add "r", tvwChild, "r1", "学生基本信息", 2
TreeView1.Nodes.Add "r1", tvwChild, "r11", "个人信息", 3
TreeView1.Nodes.Add "r1", tvwChild, "r12", "家庭信息", 3
TreeView1.Nodes.Add "r", tvwChild, "r2", "学习成绩", 4
TreeView1.Nodes.Add "r2", tvwChild, "r21", "专业成绩", 5
TreeView1.Nodes.Add "r2", tvwChild, "r22", "英语成绩", 5
TreeView1.Nodes.Add "r", tvwChild, "r3", "社团活动", 6
TreeView1.Nodes.Add "r3", tvwChild, "r31", "政治面貌", 7
TreeView1.Nodes.Add "r3", tvwChild, "r32", "获奖情况", 7
For i = 1 To TreeView1.Nodes.Count
TreeView1.Nodes(i).Expanded = True
Next i
End Sub
全部回答
  • 1楼网友:躲不过心动
  • 2021-02-14 17:28

这个简单:窗体加载treeview控件,

private sub form_load() treeview1.checkboxes = true treeview1.linestyle = tvwrootlines treeview1.nodes.add , , "a", "华北dc" treeview1.nodes.add "a", tvwchild, "b", "北京dc" treeview1.nodes.add "b", tvwchild, "c", "bj-02a" treeview1.nodes.add "c", tvwchild, , "bj-02a-01-1" treeview1.nodes.add "c", tvwchild, , "bj-02a-02-1" treeview1.nodes.add "c", tvwchild, , "bj-02a-03-1" treeview1.nodes.add "c", tvwchild, , "bj-02a-04-1" treeview1.nodes.add "c", tvwchild, , "bj-02a-05-1" treeview1.nodes.add "b", tvwchild, "d", "bj-02b" treeview1.nodes.add "d", tvwchild, , "bj-02b-01-1" treeview1.nodes.add "d", tvwchild, , "bj-02b-02-1" treeview1.nodes.add "d", tvwchild, , "bj-02b-03-1" treeview1.nodes.add "d", tvwchild, , "bj-02b-04-1" treeview1.nodes.add "d", tvwchild, , "bj-02b-05-1" end sub

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯