刷新后加上一句:
if
treeview1.nodes.count
>=
1
then
treeview1.nodes(1).selected
=
true
这样可以实现选中第一个节点
不知道您说的是不是这个意思?
Set
MyNode
=
TreeView1.SelectedItem
MyNode.ForeColor
=
vbRed
MyNode.BackColor
=
vbYellow
Set MyNode = TreeView1.SelectedItem
MyNode.ForeColor = vbRed
MyNode.BackColor = vbYellow