Hallo,
ich habe eine Frage zum Kontextmenü. Es gibt die Eigenschaft "ShowImageMargin", mit der ich den linken Rand für die Bilder ein- und ausschalten kann.
Dies funktioniert wunderbar, solange ich mich in der ersten Menü-Ebene befinde. Allerdings gelingt es mir nicht, das Gleiche auch für die zweite Menüebene einzustellen.
Ich habe das Menü mit Visual C# 2010 Express im Designer erstellt. Links ist die obere Ebene (1), rechts die 2. Ebene (2). Der Pfeil zeigt auf die ImageMargin, die ich gerne los sein will.
Vielleicht hat jemand von euch einen Tip für mich.
Vielen Dank schon mal.
Schorschie
EDIT am 21.09.2011, Habe das Problem selbst gelöst
Für alle Interessierten:
Es scheint hierfür keine "saubere" Methode zu geben, aber diese Information aus dem Internet hat mir weitergeholfen und sie funktioniert sogar:
Zitat: |
It is possible to do this but its not intuitive:
1. Drag a ContextMenuStrip onto your form, it will be named contextMenuStrip1
2. Add a menu item to the context menu to contextMenuStrip1
3. Drag another ContextMenuStrip onto your form, it will be named contextMenuStrip2
4. Select the menu item created in 2 and set its DropDown property to contextMenuStrip2
5. Change ShowImargeMargin for both contextMenuStrip1 and contextMenuStrip2 to false
And that's it. For every submenu you create you will need a separate context menu strip which is a bit silly. I actually suggest that you post a suggestion on the Microsoft Product Feedback Center suggesting that the menu items follow their parent (in this case the ContextMenuStrip) when it comes to displaying the image margin.
|
Wer es selbst noch mal komplett nachlesen möchte:
social.msdn.microsof...5-82c8-2b7e9e9a6a01/
Gruß
Schorschie