1、子节点中间排序不正确1和11,12,13在一起,2和21,22,23在一起。
2、添加子节点的时候中间会少节点数
下面有图片,请各位帮我分析一下。谢谢了
图片说明:
最佳答案
TreeView的使用
Dim obj
Dim NodeIndex
Set obj = HMIRuntime.Screens("NewPdl0").ScreenItems("Treeview1")
obj.Style = 6
obj.LineStyle = 1
obj.Nodes.Add ,1,"List","剧目"
obj.Nodes.Add "List",4,"List1","bsfgnnfg"
obj.Nodes.Add "List1",4,"Screen1","场景1"
obj.Nodes.Add "Screen1",4,"Screen11","场景11"
obj.Nodes.Add "Screen11",1,"Screen12","场景12"
obj.Nodes.Add "Screen12",1,"Screen13","场景13"
obj.Nodes.Add "List1",4,"Screen2","场景2"
obj.Nodes.Add "Screen2",4,"Screen21","场景21"
obj.Nodes.Add "Screen21",1,"Screen22","场景22"
obj.Nodes.Add "Screen22",1,"Screen23","场景23"
obj.Nodes.Add "List1",4,"Screen3","场景3"
obj.Nodes.Add "List1",4,"Screen4","场景4"
obj.Nodes.Add "List1",4,"Screen5","场景5"
1)Node结点
① Node结点:是TreeView控件中的一项,它包含图像与文本。
② Nodes结点集合:包含一个或多个Node结点。
(2)Add方法
①作用:为TreeView控件添加节点和子节点。
②定义格式
TreeView1.nodes.Add(Relative,Relationship,Key,Text, Image,SelectedImage)
其中:
◆ Relative参数:添加新结点时,其父结点键值Key。添加根结点时,此项为空。
◆Relationship参数:新结点的相对位置:
tvwlast—1:新节点位于同级别所有节点之后;
tvwNext—2:新节点位于当前节点之后;
tvwPrevious—3:新节点位于当前节点之前;
tvwChild—4:新节点成为当前节点的子节点。
提问者对于答案的评价:
谢谢你
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc173244.html