MenuCommand.Supported Property
.NET Framework (current version)
Gets or sets a value indicating whether this menu item is supported.
Assembly: System (in System.dll)
Property Value
Type: System.Booleantrue if the item is supported, which is the default; otherwise, false.
The following code example creates a MenuCommand object, configures its properties, and adds it to the IMenuCommandService.
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _ Public Class CDesigner Inherits System.ComponentModel.Design.ComponentDesigner Public Overrides Sub Initialize(ByVal comp As IComponent) MyBase.Initialize(comp) Dim mcs As IMenuCommandService = CType(comp.Site.GetService(GetType(IMenuCommandService)), IMenuCommandService) Dim mc As New MenuCommand(New EventHandler(AddressOf OnF1Help), StandardCommands.F1Help) mc.Enabled = True mc.Visible = True mc.Supported = True mcs.AddCommand(mc) System.Windows.Forms.MessageBox.Show("Initialize() has been invoked.") End Sub Private Sub OnF1Help(ByVal sender As Object, ByVal e As EventArgs) System.Windows.Forms.MessageBox.Show("F1Help has been invoked.") End Sub End Class
.NET Framework
Available since 1.1
Available since 1.1
Show: