目录树上光标移动,背景色显示代码加上了,但是光标移动过程中目录树闪烁
static pnd As object
Dim tree As System.windows.Forms.treeview = e.sender.basecontrol
Dim x As Integer = System.Windows.Forms.Cursor.Current.Position.X
Dim y As Integer = System.Windows.Forms.Cursor.Current.Position.Y
Dim pt = tree.PointToClient(new Point(X, Y)) '取当前坐标
Dim nd As System.Windows.Forms.TreeNode = tree.GetNodeAt(pt) '取坐标所在位置的节点
If nd Is Nothing OrElse pnd Is Nothing OrElse pnd.name <> nd.name Then
For Each nnd As WinForm.TreeNode In e.Sender.AllNodes
nnd.BackColor = color.white '选中节点背景色
nnd.ForeColor = color.blue '选中节点字体色
Next
If nd IsNot Nothing
nd.BackColor = color.PeachPuff '鼠标移动在未选中节点上的背景色
nd.ForeColor = color.blue '鼠标移动在未选中节点上的字体颜色
End If
End If
pnd = nd
,求助
怎样设置,光标在目录树上移动,目录树不闪烁
是否窗口打开后生成目录树,下面代码和排序代码冲突?
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("中国", "省市项目名称|考核板块|成果状态|设计类别")
Tables("中国").Sort = "设计类别,省市项目名称,片区负责人,项目负责人,正式成果名称"
[此贴子已经被作者于2020/6/23 18:03:09编辑过]