Solved

ContextMenuStrip

Posted on 2006-11-14
6
561 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 250 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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