以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]LayersTree鼠标光标移动目录树节点字体背景色突显 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=177723) |
-- 作者:miaoqingqing -- 发布时间:2022/6/1 9:11:00 -- [求助]LayersTree鼠标光标移动目录树节点字体背景色突显 如题,LayersTree下面代码报错,求助修改 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 |
-- 作者:有点蓝 -- 发布时间:2022/6/1 10:48:00 -- 代码放在哪里的,提示什么错误? |