|
|||||||
|
|
|
|||||
|
|
|||||||
Preparations:
1. Add a Toolbar control
2. Add a Toolbar button named 't2' with the property of tbrDropDown, or
add below codes to implement the same thing on run time: Toolbar1.Buttons.Add(Caption:= i, Style:= tbrDropDown)
Codes:
Private Load()
Toolbar1.Buttons("t2").ButtonMenus.Add Text:="Help"
Toolbar1.Buttons("t2").ButtonMenus.Add Text:="Options"
end sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As ComctlLib.ButtonMenu)
Select Case ButtonMenu.Index
Case 1
MsgBox "Press the button."
Case 2
MsgBox "Offer some option"
End Select
End Sub
Private Sub Toolbar1_ButtonDropDown(ByVal Button As MSComctlLib.Button)
Debug.Print " ButtonDropDown !"
End Sub
Copyright (c) 1999 - 2001, robert han, all rigths are reserved.