Results 1 to 3 of 3

Thread: DropDown button in a Toolbar.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Auckland, NZ
    Posts
    182

    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.

  2. #2
    Member Vahid's Avatar
    Join Date
    Aug 2002
    Location
    Iran
    Posts
    37

    Wink

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Auckland, NZ
    Posts
    182
    Thanks, Vahid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width