Solved

ContextMenuStrip

Posted on 2006-11-14
6
575 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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