Intersoft WebDesktop Documentation
OnContextMenu Property
See Also  Example Send Feedback
ISNet.WebUI.WebDesktop Namespace > WebDesktopClientSideEvents Class : OnContextMenu Property


Glossary Item Box

Gets or sets the javascript function to invoke when users right click on valid objects to display its context menu.

Syntax

Visual Basic (Declaration) 
Public Property OnContextMenu As String
Visual Basic (Usage)Copy Code
Dim instance As WebDesktopClientSideEvents
Dim value As String
 
instance.OnContextMenu = value
 
value = instance.OnContextMenu
C# 
public string OnContextMenu {get; set;}

Remarks

WebDesktopManager provides a solid Web User Interface platform engineered with extensibility in mind. In the Context Menu area, developers can extend the menu further to meet application-specific scenarios.

Using OnContextMenu client side event you can handle and put your codes to perform additional logics to the menu in the context.

Example

The following codes demonstrate how to extend the window's system context menu by adding a new About menu item.
C#Copy Code
function DesktopManager_OnContextMenu(controlId, objectType, contextObject, menu)
{
    if (objectType == "Window")
        {
                if (menu.Items.GetNamedItem("mnuAbout") == null)
                    menu.Items.Add( new WebMenuItem("mnuAbout", "About...") );
    }
}

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.