|
楼主 |
发表于 2015-12-7 23:09
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
cTreeview类的方法
1 Public Function AddNode(Optional Relative As Variant, Optional Relationship As TreeRelationshipConstants = tvwChild, _
Optional Key As String, Optional Text As String, _
Optional Image As Integer, Optional SelectedImage As Integer) As Node
控件的增加节点方法, 类似微软Treeview控件中的Nodes.Add方法, Relative参数指定相关的节点,可以是序号,关键字或ID
Relationship参数指定关联节点的关系,枚举类型, 可以指定是子节点,下一节点或下一节点等
可选Key是节点的关键字, 如果节点有关键字,可以根据这个Key用Item属性得到这个节点
Text是节点文本, Image是节点的图标序号, SelectedImage是节点选中时的图标序号
2 Public Sub RemoveNode(Index As Variant)
删除一个节点, Index参数可以是序号,关键字或ID
3 Public Sub Clear()
清除整个控件的节点
4 Public Sub Refresh()
控件强制进行刷新
5 Public Function FindNode(sText As String, Optional SearchInSubText As Boolean = True, Optional Compare As VbCompareMethod = vbBinaryCompare) As Node
查找节点的方法,sText参数是要查找的文本,可选参数指定查找范围是否包括子文本(多列文本)以及是否大小写敏感
6 Public Function HitTest(ByVal X As Single, ByVal Y As Single) As Node
判断在X,Y坐标下是哪个节点, 参数为横竖坐标, 单位是磅
7 Public Sub StartLabelEdit(nodX As Node, Optional ByVal Col As Long = 1)
启动节点编辑,nodX指定编辑的节点, Col指定编辑是文本的第几列. (此功能未编写)
8 Public Function GetTreeString(Optional Index As Variant, Optional OutputInfo As OutputInfoEnum, Optional Title As Boolean = True) As String
得到节点树的字符串,Index指定节点,OutputInfo指定字符串包含什么信息,Title指定字符串开始是否包含标题
9 Public Sub PrintViewTree()
打印可见的树在调试窗口中, 调试用
10 Public Function NewEnum() As IEnumVARIANT
集合枚举函数, 你不会直接用到, 这个函数是让你可以使用For…Each…Next这样的句式, 语言碰到这样的句式时会
生成一个枚举类,然后每次调用枚举类的Skip,Move等方法.
这个函数应该隐藏起来, 但我即使设置了隐藏属性也不顶用, 有谁知道方法吗?
cTreeview类的事件
1 Public Event ColumnClick(ByVal Col As Long)
事件在点击列时触发, 参数是第几列
2 Public Event BeforeLabelEdit(ByRef Cancel As Boolean)
事件在节点开始编辑时触发, Cancel参数返回True可以阻止节点进入编辑状态
3 Public Event AfterLabelEdit(ByRef Cancel As Boolean, ByVal NewString As String)
事件在节点结束编辑并在保存前时触发, Cancel参数返回True可以阻止节点保存编辑,NewString是新编辑的文本
4 Public Event Click()
事件在点击控件时触发
5 Public Event DblClick()
事件在双击控件时触发
6 Public Event Collapse(nodX As Node)
事件在节点收缩时发生,nodX是收缩的节点
7 Public Event Expand(nodX As Node)
事件在节点展开时发生,nodX是展开的节点
8 Public Event NodeCheck(nodX As Node)
事件在节点的Checkbox被点击时发生, nodX是被点击的节点
9 Public Event NodeClick(nodX As Node, ByVal Col As Long)
事件在节点被点击时发生, nodX是被点击的节点,Col是被点击第几列
10 Public Event NodeRightClick(nodX As Node, ByVal Col As Long)
事件在节点被右击时发生, nodX是被右击的节点,Col是被点击第几列
11 Public Event NodeDblClick(nodX As Node, ByRef Toggle As Boolean)
事件在节点被双击时发生, nodX是被双击的节点,Toggle参数返回False可以阻止节点展开或收缩
12 Public Event NodeChanged(nodX As Node)
节点改变文本,前景色,背景色,加粗,图标…时触发
13 Public Event SelectedNodeChanged()
选定节点改变时触发
14 Public Event KeyDown(ByRef KeyCode As Integer, ByRef Shift As Integer)
15 Public Event KeyPress(ByRef KeyAscii As Integer)
16 Public Event KeyUp(ByRef KeyCode As Integer, ByRef Shift As Integer)
键盘事件, 就不说了
17 Public Event MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
18 Public Event MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
19 Public Event MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
鼠标事件,也不说了
|
|