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


Glossary Item Box

Specifies whether this menu item is enabled or not.

Syntax

Visual Basic (Declaration) 
Public Property Enabled As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebMenuItem
Dim value As Boolean
 
instance.Enabled = value
 
value = instance.Enabled
C# 
public bool Enabled {get; set;}

Example

The following codes show you how to enable and disable menu items programmatically. For more details please read the Enabling and Disabling MenuItem on See Also section.
C#Copy Code
protected void Button1_Click(object sender, EventArgs e)
{
    WebMenuBar1.Menus[0].Items.GetNamedItem("mnuSave").Enabled = false;
    WebMenuBar1.Menus[0].Items.GetNamedItem("mnuSaveAll").Enabled = false;
    Label1.Text = "MenuItem Save and SaveAll have been disabled";
}
protected void Button2_Click(object sender, EventArgs e)
{
    WebMenuBar1.Menus[0].Items.GetNamedItem("mnuSave").Enabled = true;
    WebMenuBar1.Menus[0].Items.GetNamedItem("mnuSaveAll").Enabled = true;
    Label1.Text = "MenuItem Save and SaveAll have been enabled";
}

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.