Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a Toolbar Dropdown Drop down?! 1

Status
Not open for further replies.

uczmeg

MIS
Mar 7, 2001
61
GB
Hi,

I have a toolbar button with the style set to dropdown and have a context menu associated with it.

It all works as you would expect.

However I would like the button to make the dropdown appear as well as the drop down arrow associated with it. The button has no other purpose in life than to hold this menu!

I've searched around, but can't see how to do this.

Cheers
Marc
 
If I'm following you correctly, you can make a picture of the arrow and put it on the button. Haven't played w/ toolbar buttons and their images for quit a while, so you may have to play with it a bit.

-Rick

----------------------
 
Hi Rick,

Not quite!

I have a toolbar button with it's picture. When you set it to be a drop down button, it gets an additional drop down arrow button beside it. I have attached a context menu to the toolbar button and it drops down when you press the side button.

What I want to do is make the main button drop down that menu too. Right now you just click on it and it does nothing (as I've not got any code to associate with that event, I want it to drop down the menu).

Does that make sense?! It is harder to explain than it actually is!

Cheers
Marc
 
you could try calling the drop down arrow button's click event. or if it's hidden away, you could record the mouse position, move the mouse to the drop down button, send a click, and return the mouse to it's original location.

I beleive that would be defined as a "Kludge" but it should work in the abscence of a more eligant solution.

-Rick

----------------------
 
Hi Rick,

I managed to solve this...

There doesn't seem to be an obvious way of detecting the click of the dropdown button, and moving the mousepointer would annoy me!

I did find the context menu has a show event and you can then attach it to a control and specify where in the control it will pop up. So I attached it to the toolbar and postioned it where the drp down would appear.

mycontextmenu.Show(ToolBar1, New System.Drawing.Point(0, 38))

Cheers
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top