Changes

Creating Context Menus in Visual Basic

31 bytes added, 13:55, 19 March 2009
Adding Context Menus to a Visual Basic Form
Context menus are added to a form in Visual Basic using the ''ContextMenuStrip'' object and associating it with a particular control. Begin by creating a new Windows Application project in Visual Studio. Next, add a ''RichTextBox'' component to the form so that the form appears as follows and name it ''MyTextBox'':
<google>ADSDAQBOX_FLOW</google>
[[Image:visual_basic_textbox_context.jpg]]
Once an item has been added to the menu right clicking on the item provides a list of properties which may be changed, such as making an item checkable, or disabling an item so that it cannot be selected by the user. It is also possible to define an image to be displayed for the menu option.
To complete this phase of the tutorial, add menu items labeled ''Hide'' and ''Show''.
== Associating a Component with a Context Menu ==