Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StandardCommands Class

Defines identifiers for the standard set of commands that are available to most applications.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)

[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
[HostProtectionAttribute(SecurityAction.LinkDemand, SharedState = true)]
public class StandardCommands

The StandardCommands type exposes the following members.

  NameDescription
Public methodStandardCommandsInitializes a new instance of the StandardCommands class.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberAlignBottomGets the CommandID for the AlignBottom command. This field is read-only.
Public fieldStatic memberAlignHorizontalCentersGets the CommandID for the AlignHorizontalCenters command. This field is read-only.
Public fieldStatic memberAlignLeftGets the CommandID for the AlignLeft command. This field is read-only.
Public fieldStatic memberAlignRightGets the CommandID for the AlignRight command. This field is read-only.
Public fieldStatic memberAlignToGridGets the CommandID for the AlignToGrid command. This field is read-only.
Public fieldStatic memberAlignTopGets the CommandID for the AlignTop command. This field is read-only.
Public fieldStatic memberAlignVerticalCentersGets the CommandID for the AlignVerticalCenters command. This field is read-only.
Public fieldStatic memberArrangeBottomGets the CommandID for the ArrangeBottom command. This field is read-only.
Public fieldStatic memberArrangeIconsGets the CommandID for the ArrangeIcons command. This field is read-only.
Public fieldStatic memberArrangeRightGets the CommandID for the ArrangeRight command. This field is read-only.
Public fieldStatic memberBringForwardGets the CommandID for the BringForward command. This field is read-only.
Public fieldStatic memberBringToFrontGets the CommandID for the BringToFront command. This field is read-only.
Public fieldStatic memberCenterHorizontallyGets the CommandID for the CenterHorizontally command. This field is read-only.
Public fieldStatic memberCenterVerticallyGets the CommandID for the CenterVertically command. This field is read-only.
Public fieldStatic memberCopyGets the CommandID for the Copy command. This field is read-only.
Public fieldStatic memberCutGets the CommandID for the Cut command. This field is read-only.
Public fieldStatic memberDeleteGets the CommandID for the Delete command. This field is read-only.
Public fieldStatic memberDocumentOutlineGets the CommandID for the Document Outline command. This field is read-only.
Public fieldStatic memberF1HelpGets the CommandID for the F1Help command. This field is read-only.
Public fieldStatic memberGroupGets the CommandID for the Group command. This field is read-only.
Public fieldStatic memberHorizSpaceConcatenateGets the CommandID for the HorizSpaceConcatenate command. This field is read-only.
Public fieldStatic memberHorizSpaceDecreaseGets the CommandID for the HorizSpaceDecrease command. This field is read-only.
Public fieldStatic memberHorizSpaceIncreaseGets the CommandID for the HorizSpaceIncrease command. This field is read-only.
Public fieldStatic memberHorizSpaceMakeEqualGets the CommandID for the HorizSpaceMakeEqual command. This field is read-only.
Public fieldStatic memberLineupIconsGets the CommandID for the LineupIcons command. This field is read-only.
Public fieldStatic memberLockControlsGets the CommandID for the LockControls command. This field is read-only.
Public fieldStatic memberMultiLevelRedoGets the CommandID for the MultiLevelRedo command. This field is read-only.
Public fieldStatic memberMultiLevelUndoGets the CommandID for the MultiLevelUndo command. This field is read-only.
Public fieldStatic memberPasteGets the CommandID for the Paste command. This field is read-only.
Public fieldStatic memberPropertiesGets the CommandID for the Properties command. This field is read-only.
Public fieldStatic memberPropertiesWindowGets the CommandID for the PropertiesWindow command. This field is read-only.
Public fieldStatic memberRedoGets the CommandID for the Redo command. This field is read-only.
Public fieldStatic memberReplaceGets the CommandID for the Replace command. This field is read-only.
Public fieldStatic memberSelectAllGets the CommandID for the SelectAll command. This field is read-only.
Public fieldStatic memberSendBackwardGets the CommandID for the SendBackward command. This field is read-only.
Public fieldStatic memberSendToBackGets the CommandID for the SendToBack command. This field is read-only.
Public fieldStatic memberShowGridGets the CommandID for the ShowGrid command. This field is read-only.
Public fieldStatic memberShowLargeIconsGets the CommandID for the ShowLargeIcons command. This field is read-only.
Public fieldStatic memberSizeToControlGets the CommandID for the SizeToControl command. This field is read-only.
Public fieldStatic memberSizeToControlHeightGets the CommandID for the SizeToControlHeight command. This field is read-only.
Public fieldStatic memberSizeToControlWidthGets the CommandID for the SizeToControlWidth command. This field is read-only.
Public fieldStatic memberSizeToFitGets the CommandID for the SizeToFit command. This field is read-only.
Public fieldStatic memberSizeToGridGets the CommandID for the SizeToGrid command. This field is read-only.
Public fieldStatic memberSnapToGridGets the CommandID for the SnapToGrid command. This field is read-only.
Public fieldStatic memberTabOrderGets the CommandID for the TabOrder command. This field is read-only.
Public fieldStatic memberUndoGets the CommandID for the Undo command. This field is read-only.
Public fieldStatic memberUngroupGets the CommandID for the Ungroup command. This field is read-only.
Public fieldStatic memberVerbFirstGets the first of a set of verbs. This field is read-only.
Public fieldStatic memberVerbLastGets the last of a set of verbs. This field is read-only.
Public fieldStatic memberVertSpaceConcatenateGets the CommandID for the VertSpaceConcatenate command. This field is read-only.
Public fieldStatic memberVertSpaceDecreaseGets the CommandID for the VertSpaceDecrease command. This field is read-only.
Public fieldStatic memberVertSpaceIncreaseGets the CommandID for the VertSpaceIncrease command. This field is read-only.
Public fieldStatic memberVertSpaceMakeEqualGets the CommandID for the VertSpaceMakeEqual command. This field is read-only.
Public fieldStatic memberViewCodeGets the CommandID for the ViewCode command. This field is read-only.
Public fieldStatic memberViewGridGets the CommandID for the ViewGrid command. This field is read-only.
Top

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.

NoteNote

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.

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.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] 
public class CDesigner : System.ComponentModel.Design.ComponentDesigner 
{
    public override void Initialize(IComponent comp) 
    {
        base.Initialize(comp);

        IMenuCommandService mcs = (IMenuCommandService)comp.Site.
                    GetService(typeof(IMenuCommandService));
        MenuCommand mc = new MenuCommand(new EventHandler(OnF1Help), StandardCommands.F1Help);
        mc.Enabled = true;
        mc.Visible = true;
        mc.Supported = true;
        mcs.AddCommand(mc);
        System.Windows.Forms.MessageBox.Show("Initialize() has been invoked.");
    }

    private void OnF1Help(object sender, EventArgs e) 
    {
        System.Windows.Forms.MessageBox.Show("F1Help has been invoked.");
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft