StandardCommands StandardCommands StandardCommands StandardCommands Class

Definition

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

public ref class StandardCommands
public class StandardCommands
type StandardCommands = class
Public Class StandardCommands
Inheritance
StandardCommandsStandardCommandsStandardCommandsStandardCommands
Derived

Examples

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.

   public ref class CDesigner: public ComponentDesigner
   {
   public:
    [PermissionSetAttribute(SecurityAction::Demand, Name="FullTrust")]
      virtual void Initialize( IComponent^ comp ) override
      {
         ComponentDesigner::Initialize( comp );
         IMenuCommandService^ mcs = static_cast<IMenuCommandService^>(comp->Site->GetService( IMenuCommandService::typeid ));
		 MenuCommand^ mc = gcnew MenuCommand( gcnew EventHandler( this, &CDesigner::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." );
      }
   };
}
[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.");
    }
}
<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

Remarks

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.

Constructors

StandardCommands() StandardCommands() StandardCommands() StandardCommands()

Initializes a new instance of the StandardCommands class.

Fields

AlignBottom AlignBottom AlignBottom AlignBottom

Gets the CommandID for the AlignBottom command. This field is read-only.

AlignHorizontalCenters AlignHorizontalCenters AlignHorizontalCenters AlignHorizontalCenters

Gets the CommandID for the AlignHorizontalCenters command. This field is read-only.

AlignLeft AlignLeft AlignLeft AlignLeft

Gets the CommandID for the AlignLeft command. This field is read-only.

AlignRight AlignRight AlignRight AlignRight

Gets the CommandID for the AlignRight command. This field is read-only.

AlignToGrid AlignToGrid AlignToGrid AlignToGrid

Gets the CommandID for the AlignToGrid command. This field is read-only.

AlignTop AlignTop AlignTop AlignTop

Gets the CommandID for the AlignTop command. This field is read-only.

AlignVerticalCenters AlignVerticalCenters AlignVerticalCenters AlignVerticalCenters

Gets the CommandID for the AlignVerticalCenters command. This field is read-only.

ArrangeBottom ArrangeBottom ArrangeBottom ArrangeBottom

Gets the CommandID for the ArrangeBottom command. This field is read-only.

ArrangeIcons ArrangeIcons ArrangeIcons ArrangeIcons

Gets the CommandID for the ArrangeIcons command. This field is read-only.

ArrangeRight ArrangeRight ArrangeRight ArrangeRight

Gets the CommandID for the ArrangeRight command. This field is read-only.

BringForward BringForward BringForward BringForward

Gets the CommandID for the BringForward command. This field is read-only.

BringToFront BringToFront BringToFront BringToFront

Gets the CommandID for the BringToFront command. This field is read-only.

CenterHorizontally CenterHorizontally CenterHorizontally CenterHorizontally

Gets the CommandID for the CenterHorizontally command. This field is read-only.

CenterVertically CenterVertically CenterVertically CenterVertically

Gets the CommandID for the CenterVertically command. This field is read-only.

Copy Copy Copy Copy

Gets the CommandID for the Copy command. This field is read-only.

Cut Cut Cut Cut

Gets the CommandID for the Cut command. This field is read-only.

Delete Delete Delete Delete

Gets the CommandID for the Delete command. This field is read-only.

DocumentOutline DocumentOutline DocumentOutline DocumentOutline

Gets the CommandID for the Document Outline command. This field is read-only.

F1Help F1Help F1Help F1Help

Gets the CommandID for the F1Help command. This field is read-only.

Group Group Group Group

Gets the CommandID for the Group command. This field is read-only.

HorizSpaceConcatenate HorizSpaceConcatenate HorizSpaceConcatenate HorizSpaceConcatenate

Gets the CommandID for the HorizSpaceConcatenate command. This field is read-only.

HorizSpaceDecrease HorizSpaceDecrease HorizSpaceDecrease HorizSpaceDecrease

Gets the CommandID for the HorizSpaceDecrease command. This field is read-only.

HorizSpaceIncrease HorizSpaceIncrease HorizSpaceIncrease HorizSpaceIncrease

Gets the CommandID for the HorizSpaceIncrease command. This field is read-only.

HorizSpaceMakeEqual HorizSpaceMakeEqual HorizSpaceMakeEqual HorizSpaceMakeEqual

Gets the CommandID for the HorizSpaceMakeEqual command. This field is read-only.

LineupIcons LineupIcons LineupIcons LineupIcons

Gets the CommandID for the LineupIcons command. This field is read-only.

LockControls LockControls LockControls LockControls

Gets the CommandID for the LockControls command. This field is read-only.

MultiLevelRedo MultiLevelRedo MultiLevelRedo MultiLevelRedo

Gets the CommandID for the MultiLevelRedo command. This field is read-only.

MultiLevelUndo MultiLevelUndo MultiLevelUndo MultiLevelUndo

Gets the CommandID for the MultiLevelUndo command. This field is read-only.

Paste Paste Paste Paste

Gets the CommandID for the Paste command. This field is read-only.

Properties Properties Properties Properties

Gets the CommandID for the Properties command. This field is read-only.

PropertiesWindow PropertiesWindow PropertiesWindow PropertiesWindow

Gets the CommandID for the PropertiesWindow command. This field is read-only.

Redo Redo Redo Redo

Gets the CommandID for the Redo command. This field is read-only.

Replace Replace Replace Replace

Gets the CommandID for the Replace command. This field is read-only.

SelectAll SelectAll SelectAll SelectAll

Gets the CommandID for the SelectAll command. This field is read-only.

SendBackward SendBackward SendBackward SendBackward

Gets the CommandID for the SendBackward command. This field is read-only.

SendToBack SendToBack SendToBack SendToBack

Gets the CommandID for the SendToBack command. This field is read-only.

ShowGrid ShowGrid ShowGrid ShowGrid

Gets the CommandID for the ShowGrid command. This field is read-only.

ShowLargeIcons ShowLargeIcons ShowLargeIcons ShowLargeIcons

Gets the CommandID for the ShowLargeIcons command. This field is read-only.

SizeToControl SizeToControl SizeToControl SizeToControl

Gets the CommandID for the SizeToControl command. This field is read-only.

SizeToControlHeight SizeToControlHeight SizeToControlHeight SizeToControlHeight

Gets the CommandID for the SizeToControlHeight command. This field is read-only.

SizeToControlWidth SizeToControlWidth SizeToControlWidth SizeToControlWidth

Gets the CommandID for the SizeToControlWidth command. This field is read-only.

SizeToFit SizeToFit SizeToFit SizeToFit

Gets the CommandID for the SizeToFit command. This field is read-only.

SizeToGrid SizeToGrid SizeToGrid SizeToGrid

Gets the CommandID for the SizeToGrid command. This field is read-only.

SnapToGrid SnapToGrid SnapToGrid SnapToGrid

Gets the CommandID for the SnapToGrid command. This field is read-only.

TabOrder TabOrder TabOrder TabOrder

Gets the CommandID for the TabOrder command. This field is read-only.

Undo Undo Undo Undo

Gets the CommandID for the Undo command. This field is read-only.

Ungroup Ungroup Ungroup Ungroup

Gets the CommandID for the Ungroup command. This field is read-only.

VerbFirst VerbFirst VerbFirst VerbFirst

Gets the first of a set of verbs. This field is read-only.

VerbLast VerbLast VerbLast VerbLast

Gets the last of a set of verbs. This field is read-only.

VertSpaceConcatenate VertSpaceConcatenate VertSpaceConcatenate VertSpaceConcatenate

Gets the CommandID for the VertSpaceConcatenate command. This field is read-only.

VertSpaceDecrease VertSpaceDecrease VertSpaceDecrease VertSpaceDecrease

Gets the CommandID for the VertSpaceDecrease command. This field is read-only.

VertSpaceIncrease VertSpaceIncrease VertSpaceIncrease VertSpaceIncrease

Gets the CommandID for the VertSpaceIncrease command. This field is read-only.

VertSpaceMakeEqual VertSpaceMakeEqual VertSpaceMakeEqual VertSpaceMakeEqual

Gets the CommandID for the VertSpaceMakeEqual command. This field is read-only.

ViewCode ViewCode ViewCode ViewCode

Gets the CommandID for the ViewCode command. This field is read-only.

ViewGrid ViewGrid ViewGrid ViewGrid

Gets the CommandID for the ViewGrid command. This field is read-only.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Security

NamedPermissionSet
for full access to system resources. Demand values: LinkDemand, InheritanceDemand. Associated state:

Applies to

See also