Solved

ContextMenuStrip

Posted on 2006-11-14
6
543 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now