首先添加一个ImageList控件到窗体上,在TreeView的属性页上把ImageList绑定好。然后你可以在创建节点时把图片添加好或者用ImageList.Nodes(Index).Image属性改变图片。
下面是两个用得到的事件:
Private Sub t_Collapse(ByVal Node As MSComctlLib.Node)'关闭节点
Private Sub t_Expand(ByVal Node As MSComctlLib.Node)'展开节点
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
MsgBox "you click button 1 of toolbar!"
Case 2
MsgBox "you click button 2 of toolbar!"
Case 3
MsgBox "you click button 3 of toolbar!"
Case Else
MsgBox "you click other button of toolbar!"
End Select
End Sub