Difference between revisions of "Creating Context Menus in Visual Basic"
(→Adding Context Menus to a Visual Basic Form) |
|||
Line 4: | Line 4: | ||
== Adding Context Menus to a Visual Basic Form == | == Adding Context Menus to a Visual Basic Form == | ||
+ | |||
+ | Context menus are added to a form in Visual Basic using the ''Context Menu Strip'' 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: | ||
+ | |||
+ | [[Image:Exampl.jpg]] |
Revision as of 19:53, 24 July 2007
Visual basic Context menus are the menus that pop up when the user clicks with the right hand mouse button over a control or area in a form. They are called context menus because the menu is usually specific to the object over which the mouse was clicked. Context menus are also sometimes referred to as Popup menus or Shortcut menus.
This chapter will provide an overview of the steps necessary to create and programme Context menus in Visual Basic. For information on creating Top-level menus see the Creating Top-Level Menus in Visual Basic chapter of this book.
Adding Context Menus to a Visual Basic Form
Context menus are added to a form in Visual Basic using the Context Menu Strip 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: