这样试一试
Private Sub Form_Load()
TreeView1.Style = tvwTreelinesPlusMinusText
TreeView1.LabelEdit = tvwManual
TreeView1.LineStyle = tvwRootLines
Set myNod = TreeView1.Nodes.Add(, , "china ", "中国 ")
Set myNod = TreeView1.Nodes.Add("china ", tvwChild, "hb ", "河北 ")
Set myNod = TreeView1.Nodes.Add("china ", tvwChild, "sx ", "山西 ")
Set myNod = TreeView1.Nodes.Add("hb ", tvwChild, "sjz ", "石家庄 ")
Set myNod = TreeView1.Nodes.Add("sx ", tvwChild, "ty ", "太原 ")
Set myNod = TreeView1.Nodes.Add(, , "america ", "美国")
End Sub
Private Sub TrV_NodeClick(ByVal 哗笑Node As MSComctlLib.Node)
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
If TreeView1.SelectedItem.Children = 0 Then 物烂'检查是否有子节点,0为无
For i = 1 To TreeView1.Nodes.Count
罩芦漏 If TreeView1.Nodes(i).Selected Then
MsgBox "您选择的是:“" & TreeView1.Nodes(i).FullPath & "”子节点!"
'系统提示
End If
Next i
End If
End Sub