June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to show context menus for multiple controls with a minimum amount of code.
Write a generic event handler that retrieves the context menu that is associated with a control.
You can associate a control with a context menu by settings the control’s ContextMenu property. However, this is only a convenience—in order to display the context menu, you must retrieve the menu and call its Show method, supplying both a parent control and a pair of coordinates. Usually, you implement this logic in an event handler for the MouseDown event.
The good news is that the logic for showing context menus is completely generic, no matter what the control is. Every control supports the ContextMenu ...
Read now
Unlock full access