1 Attachment(s)
Setting a ContextMenuStrip's width manually = submenu "arrows" in the wrong place
Hey guys,
I've got a context menu strip that I would like to appear at a specific width, so I set its autosize to "false", and specified an exact width for it. Which works (kinda). Only problem now is, the submenu "arrows" that it contains no longer appear at the far right side of the control, as they should (they are closer to the middle). Here's a screenshot...
Attachment 114053
How do I fix this? I couldn't find any property that controls the location of the arrows.
Thanks!
1 Attachment(s)
Re: Setting a ContextMenuStrip's width manually = submenu "arrows" in the wrong place
Quote:
Originally Posted by
BMAN645
How do I fix this? I couldn't find any property that controls the location of the arrows.
Easiest way I can see to do that is to just leave autosize to true for the ContextMenuStrip and all the menu items. Add a menu item (to top of menu) and type a long word for the Text property so menu resizes to width you want, and set that menus Visible property to false. Now when menu is displayed you don't see top menu item but width is still intact.
Attachment 114073
Re: Setting a ContextMenuStrip's width manually = submenu "arrows" in the wrong place
Quote:
Originally Posted by
Edgemeal
Easiest way I can see to do that is to just leave autosize to true for the ContextMenuStrip and all the menu items. Add a menu item (to top of menu) and type a long word so menu resizes to width you want, and set that menus Visible property to false. Now when menu is displayed you don't see top menu item but width is still intact.
Attachment 114073
Nice and easy quick trick :)
Re: Setting a ContextMenuStrip's width manually = submenu "arrows" in the wrong place
Thanks Edgemeal. Yeah, I actually thought about doing something similar (just typing a bunch of blank space after one of the menu items), which has the same effect... but I was hoping to come up with a less "ghetto" solution, lol. But I reckon it will get the job done.