|
-
Aug 17th, 2002, 05:44 AM
#1
Thread Starter
Addicted Member
DropDown button in a Toolbar.
Toolbar button with the DropDown style, how to use it? Can anyone give a sample of that?
The so named ‘Help’ do not provide any information how to use it.
-
Aug 19th, 2002, 06:49 PM
#2
Member
There are two ways to do that:
1. Design Time: After adding Toolbar to your form and adding Buttons to it, add a ContextMenu to your form and add appropriate Menu items to it by clicking the ContextMenu and typing menu text. Then in your Toolbar Buttons property page select the button you want to be a dropdown button and change it's Style property to DropDownButton and change it's DropDownMenu property to the ContextMenu that you've just created.
2: Run Time:
'Add this to the top of your form
Imports System.Windows.Forms
'Add this to some procedure
Dim myContextMenu As New ContextMenu()
Dim myFirstItem As New MenuItem("First")
Dim mySecondItem As New MenuItem("Second")
myContextMenu.MenuItems.AddRange(New MenuItem() {myFirstItem, mySecondItem})
'Use your DropDownButton index instead of 0
With Me.myToolbar.Buttons(0)
.Style = ToolBarButtonStyle.DropDownButton
.DropDownMenu = myContextMenu
End With
Good luck, Bona
-
Aug 19th, 2002, 11:14 PM
#3
Thread Starter
Addicted Member
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
|