|
-
Mar 15th, 2001, 08:42 AM
#1
Thread Starter
Lively Member
hello i am just beginning to program with visual basic. i added a toolbar control to my form. added a drop down style button to work. i was wondering how to code the menu for the drop down menu........without using form.popupmenu.
-
Mar 15th, 2001, 09:14 AM
#2
Frenzied Member
ok you can goto my site and download the source for Writer2 its called writer2Source.zip. ok but ill tell you here also
double click the toolbar in the sub type
Code:
select case button.key
case "name of key"
code
case "name of key2"
code
case "name of key3"
code
end select
you have to put the keys where they belong name of key 1,2,3 are the name of the keys that belong to the button.
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Mar 15th, 2001, 09:16 AM
#3
Fanatic Member
Try using buttonMenuClick. It looks like you can only have one drop down button per toolbar though.
Code:
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Select Case ButtonMenu.Index
Case 1
MsgBox "button 1 clicked"
Case 2
MsgBox "button 2 clicked"
End Select
End Sub
-
Mar 15th, 2001, 09:40 AM
#4
Thread Starter
Lively Member
here is what i have so far....i have the menu coming up ....all i need now i to have a click event for each menu item........
Private Sub Toolbar1_ButtonClick(ByVal button As MSComctlLib.button)
'code to execute main button click
End Sub
Private Sub Toolbar1_ButtonDropDown(ByVal button As MSComctlLib.button)
'code to make a menu for the drop down portion of the button
button.ButtonMenus.Clear
button.ButtonMenus.Add.Text = "menu item 1"
button.ButtonMenus.Add.Text = "menu item 2"
End Sub
-
Mar 15th, 2001, 10:34 AM
#5
Thread Starter
Lively Member
I got it.....i cant believe it took me so long.....thanks for the help.
Private Sub Toolbar1_ButtonClick(ByVal button As MSComctlLib.button)
'code to execute main button click
End Sub
Private Sub Toolbar1_ButtonDropDown(ByVal button As MSComctlLib.button)
'code to make a menu for the drop down portion of the button
button.ButtonMenus.Clear
button.ButtonMenus.Add.Text = "menu item 1"
button.ButtonMenus.Add.Text = "menu item 2"
End Sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
'code for clicking on the different items of the menu
x = Right(ButtonMenu.Text, 1)
Select Case x
Case 1
MsgBox 1
Case 2
MsgBox 2
Case Else
MsgBox "somethings wrong"
End Select
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|