Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

Custom Context Menu Strip

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
msnews.microsoft.com - 25 Jul 2004 16:13 GMT
I created a custom context menu strip with the hopes that I could override
the Show method. So I wrote a Show for each of the 5 that ContextMenuStrip
stupports ... put a breakpoint in them, and added the control to the form.

But alas, none of my breakpoints are being hit!

How is the dang thing being shown?
Tom Dacon - 25 Jul 2004 17:56 GMT
I'm not clear on what you mean by a context menu strip - perhaps that's
something new in the 2.0 platform, and I haven't seen that yet - but the
usual method for doing custom painting on menu items, either main menu or
context menu items, is to set the menu item's OwnerDraw property to True,
and then provide event handlers for the MeasureItem and DrawItem methods. In
the MeasureItem event handler you tell the runtime how much space you're
going to need for the menu item, and in the DrawItem event handler you paint
your visual representation of the menu item on the Graphics object that's
supplied to the event handler. You need to do this for each menu item you're
going to display.

HTH,
Tom Dacon
Dacon Software Consulting

> I created a custom context menu strip with the hopes that I could override
> the Show method. So I wrote a Show for each of the 5 that ContextMenuStrip
[quoted text clipped - 3 lines]
>
> How is the dang thing being shown?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.