StandardCommands Class
Defines identifiers for the standard set of commands that are available to most applications.
Assembly: System (in System.dll)
'Declaration <PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _ <PermissionSetAttribute(SecurityAction.LinkDemand, Name := "FullTrust")> _ <HostProtectionAttribute(SecurityAction.LinkDemand, SharedState := True)> _ Public Class StandardCommands 'Usage Dim instance As StandardCommands
Note: |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: SharedState. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
This class defines CommandID identifiers for standard commands that are available to designers.
To add a command from the StandardCommands class to a designer menu, you must call the AddCommand method of an IMenuCommandService and add a MenuCommand that contains a CommandID from StandardCommands.
The following code example illustrates how to add a member of the StandardCommands class to a MenuCommand and how to add the MenuCommand to an 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
- NamedPermissionSet
for full access to system resources. Demand values: LinkDemand, InheritanceDemand. Associated state: FullTrust
System.ComponentModel.Design.StandardCommands
System.Windows.Forms.Design.MenuCommands
System.Workflow.ComponentModel.Design.WorkflowMenuCommands
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: