Question Button with Dropdown

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
What control should i use if i want a button with default text on it and when i press on it, it give a drop down menu that i can select different commands.

I tried a combobox which seems to be very close to what i want. i set the dropdownstyle to dropdownlist so it looks like a button. but i cant seem to set a default text on the box and i dont want this text to be in the item list. also when i set the dropdownwidth to a value larger than the combobox width, it will align left. how can i make it align right?
 
Add a ContextMenuStrip to your form and put the "Commands" there, then in the button's click event show the ContextMenu manually.
 
cms

wouldnt the menu just be floating under where you mouse click instead of aligning below the button?
 
Check out the different overloads to the show method, you can place it anywhere you want. Even to a control's location.
 
Back
Top