如题,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