|
-
Jul 14th, 2006, 03:07 PM
#1
Thread Starter
Hyperactive Member
[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?
-
Jul 14th, 2006, 03:12 PM
#2
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.
-
Jul 14th, 2006, 03:17 PM
#3
Thread Starter
Hyperactive Member
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!
-
Jul 14th, 2006, 03:24 PM
#4
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
-
Jul 14th, 2006, 03:29 PM
#5
Thread Starter
Hyperactive Member
Re: [2005] Context Menu
No DropDownMenu, and no Style... Are we both talking about a ToolStrip, and a ToolStripButton?
-
Jul 14th, 2006, 03:32 PM
#6
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.
-
Jul 14th, 2006, 03:33 PM
#7
Thread Starter
Hyperactive Member
-
Jul 14th, 2006, 04:50 PM
#8
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."
-
Jul 15th, 2006, 01:23 PM
#9
Thread Starter
Hyperactive Member
-
Jul 15th, 2006, 10:01 PM
#10
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.
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
|