June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to create a menu that includes pictures, formatted text, or colored item backgrounds.
Set the OwnerDraw property to True for each MenuItem control you want to draw, and handle the MeasureItem and DrawItem events.
The MenuItem class that is included with the .NET Framework is fairly limited. It doesn’t provide any ability to change menu font, colors, or even add the common thumbnail icon. To add any of these enhancements, you’ll need to combine your menu with custom drawing logic.
Fortunately, .NET makes it easy to replace the standard drawing logic with your own custom code. All you need to do is set the OwnerDraw property for a MenuItem to True. A context menu or main menu can contain ...
Read now
Unlock full access