wanshan说的方法还是没有实现我想要的效果,得到焦点后节点字体变颜色,这点达到了,问题是失去焦点后恢复常态,这点我就做不出来了,不知道该如何处理得到焦点和失去焦点之间的矛盾,555作者: kangking 时间: 2009-10-10 11:06
Private Sub TreeView1_NodeClick(ByVal Node As Object)
Dim nod As Node
For Each nod In TreeView1.Nodes
If Node = nod Then
'改变颜色和粗细
With Node
.ForeColor = vbRed
.Bold = True
.BackColor = vbGreen
End With
Else
'恢复原颜色和粗细
With nod
.ForeColor = vbBlack
.Bold = False
.BackColor = vbYellow