Private Sub Command1_Click() TreeView1.Nodes("b1").Selected = True End Sub
Private Sub Form_Load() TreeView1.HideSelection = False
TreeView1.Nodes.Add , , "root", "root" TreeView1.Nodes.Add "root", tvwChild, "a1", "a1"
TreeView1.Nodes.Add "a1", tvwChild, "a1-1", "a1-1" TreeView1.Nodes.Add "a1", tvwChild, "a1-2", "a1-2"
TreeView1.Nodes.Add "root", tvwChild, "b1", "b1" TreeView1.Nodes.Add "b1", tvwChild, "b1-1", "b1-1" TreeView1.Nodes.Add "b1", tvwChild, "b1-2", "b1-2"
TreeView1.Nodes.Add "root", tvwChild, "c1", "c1" End Sub |