Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ContextMenuStrip

Posted on 2006-11-14
6
Medium Priority
?
596 Views
Last Modified: 2007-12-19
I have created submenus on a contextmenustrip.
I have removed the image margin on the main menu, but I can't see a way of doing this on sub-menus.
Also how can I change the back colour of an item when hovering over it?
0
Comment
Question by:broadbent
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:Alfredo Luis Torres Serrano
ID: 17939944
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.
0
 
LVL 4

Author Comment

by:broadbent
ID: 17940503
Sorry but you've misunderstood the question

ContextMenuStrip                  ShowImageMargin=False
 |
  MenuItem1                           no image margin
  MenuItem2
  MenuItem3 -> MenuItem3a       image margin
                        MenuItem3b

MenuItems1-3 are in the ContextMenuStrip.Items collection
MenuItem3a and b are in the MenuItem3.DropdownItems collection

I want all the menuitems to have no image margin.
0
 
LVL 12

Expert Comment

by:Alfredo Luis Torres Serrano
ID: 17940880
Menuitem3a and menuitem3b have to be differentes menu strips. as i say in myu comment

 For every submenu you create you will need a separate context menu strip which is a bit silly.
 Change ShowImargeMargin  for each menustrip

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:broadbent
ID: 17945673
Then why does the IDE allow you to enter submenus?
Is this a bug?
0
 
LVL 12

Accepted Solution

by:
Alfredo Luis Torres Serrano earned 1000 total points
ID: 17947161
Nope this is not a bug.

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.

0
 
LVL 4

Author Comment

by:broadbent
ID: 17947309
AQctually what about the other part of the question-
Also how can I change the back colour of an item when hovering over it?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question