Results 1 to 10 of 10

Thread: [2005] Context Menu

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    [2005] Context Menu

    How do I make a context menu show up when I click on a ToolStrip Button? And if I use code:
    ContextMenuStrip1.Show()
    it displays it in the top left.
    How do I make it show up on a left click under the button?
    Katya Chehova is best!

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [2005] Context Menu

    Before you go to far with this, are you attempting to make a mainmenu type control (with file, edit, etc)?

    If you are, there's another control called mainmenu that will probably suit your needs alot better.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Re: [2005] Context Menu

    No. A context menu that shows up when I left click a button on a toolstrip. That is what I need!
    Katya Chehova is best!

  4. #4
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [2005] Context Menu

    Ok, just making sure.

    To do this, in design view:
    Select the toolbar
    In the properties, scroll down to items
    Click the "..." button
    Allof your buttons will be listed. Each one has a property called "DropDownMenu"
    Select the context menu you want
    also, in that same window, go to "Style " and select DropDownButton

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Re: [2005] Context Menu

    No DropDownMenu, and no Style... Are we both talking about a ToolStrip, and a ToolStripButton?
    Katya Chehova is best!

  6. #6
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [2005] Context Menu

    No

    I was in 2003 using toolbar control. If no one helps in the next hour; I'll be back home and have 2005 infront of me. I'll see if I can come up with something.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Re: [2005] Context Menu

    Alright, thanks!
    Katya Chehova is best!

  8. #8
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [2005] Context Menu

    Ok, got it. Don't use regular buttons, use splitButtons. They have a menu feature built into them if you click the down arrow on their right. From there, you can dd functionality to each one.

    Also, with these; you don't need your own contextmenu. They have them "built in."

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Re: [2005] Context Menu

    Ah, I see! Thanks man!
    Katya Chehova is best!

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Context Menu

    There are three types of buttons you can place on a tool strip. The regular ToolStripButton is designed to perfrom an action when you click it. The ToolStripDropDownButton is designed to diplay a menu when you click it. The ToolStripSplitButton is a combination of the two, where the main section of the button behaves like a ToolStripButton and the right-hand section behaves like a ToolStripDropDownButton. If you always want a drop-down menu then use the ToolStripDropDownButton. If you want to be able to perform an action directly or provide options then use the ToolStripSplitButton. An example of the split button is the "New Project" button on the VS 2005 tool bar. If you click the main button it creates a new project. If you click the righ-hand side it gives you multiple options.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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