Search KB Filter article types
ContextMenu
Categories: Menus
Tags: Architects, Developers, Navigation, 1. Beginner, 2. Intermediate, 3. Advanced, Navigation, Pre v6.3, v6.3, v6.4 and Later
Revision: 1
Posted: 11/July/2009
Updated: 04/Dec/2010
Status: Publish
Types: Reference

This article will have a few sections added to it soon, based on the following article type skeleton: Control
Overview

The ContextMenu control is functionally equivialent to the Windows Forms ContextMenu control and serves the purpose to provide you with shortcut menus or context sensitve menus that you can attach to your controls and access via right mouse click on the control. ContextMenu fairly resembles the MainMenu control, which is for use as the menu structure on your mainform.

There is a vital difference between how events are used between on ContextMenu versus MainMenu. On MainMenu, the events on the MainMenu control itself fire, but on the ContextMenu, no event on the ContextMenu control itself fires. Instead, the control you attach the ContextMenu to has a MenuClick event, that is used for event handling of ContextMenu related events. This means that you don't attach any event handlers to the ContextMenu control itself.

Each ContextMenu has a MenuItems collection, which is a collection of zero or more MenuItem controls, representing the items on the menu. Each MenuItem has it's own MenuItems collection, thus supporting a multilvel menu structure.

Availability

The ContextMenu is one of the Out of the Box standard controls, which means it is free and available in all Visual WebGui versions.

Relevant membersProperties
Name
Description
MenuItems
Collection of MenuItem controls representing the items on the ContextMenu
MenuItem.MenuItems
Collection of MenuItem controls for the MenuItem, representing further sublevels of the menu structure
MenuItem.Text
The text that will show on the menu for this MenuItem
MenuItem.Tag

Tag is a user definable storage, for storing whatever we like to store. It can contain any object type. Most often it is used to store a string or numerical value, for the procedure handling the MenuClick event to know what MenuItem was selected.

It can however be used to store any value, which could even be used as an address to a function to handle the processing when that item is selected on the menu.


Methods
Name
Description
Update
Used to refresh the control after some programmatic changes have been made.


Events
NameDescription
MenuClick
This event is not used in Visual WebGui
PopUp


Samples of useTips and TricksNo event fires on ContextMenu - use MenuClick event on control

As mentioned in the overview, there is no menu related event that fires in VisualWebGui on the ContextMenu control. Instead, you use the MenuClick event of the various controls you attach your ContextMenu to.

Same ContextMenu - multiple Controls

The same ContextMenu instance can be used for multiple Controls and no changes are needed on the ContextMenu to support that.

SDK Version highlightsSee also
RererencesOther references


About the author

Related Articles

Menus  
Title Update Author
This video demonstrates how to create and use a context menu in Visual WebGui.
Tags: Developers, 1. Beginner, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
01/Jan/2009    2009/01/01
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23
Tags: Architects, Developers, Navigation, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
04/Dec/2010    2010/12/04
Tags: Developers, 1. Beginner, 2. Intermediate, Customization, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
24/May/2010    2010/05/24
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS