ContextMenuStrip


The ContextMenuStrip component represents a context menu. When you select it on the form at design time, the development environment displays the menu at the top of the form. Enter the menu’s items, use the Property window to set their names and other properties, and double-click the items to edit their event handlers. See the section “MenuStrip” later in this appendix for information on menu item properties and events.

To use a ContextMenuStrip, you need to attach it to a control. Select the control that you want to use it. Open the Properties window, click the drop-down arrow to the right of the control’s ContextMenuStrip property, and select your ContextMenuStrip component from the list. The rest is automatic. When the user right-clicks this control at runtime, Visual Basic automatically displays the ContextMenuStrip. If the user selects one of the menu’s items, Visual Basic triggers the menu item’s event handler.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net