StandardCommandsとは? わかりやすく解説

StandardCommands クラス

ほとんどのアプリケーションで使用できる一連の標準コマンドの識別子を定義します。

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)
構文構文

Public Class StandardCommands
Dim instance As StandardCommands
public class StandardCommands
public ref class StandardCommands
public class StandardCommands
public class StandardCommands
解説解説

このクラスは、デザイナが使用できる標準コマンドの CommandID 識別子を定義します。

コマンドを StandardCommands クラス からデザイナのメニューに追加するには、IMenuCommandService の AddCommand メソッドを呼び出し、StandardCommands からの CommandID を格納する MenuCommand を追加する必要があります。

メモメモ

このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。

使用例使用例

StandardCommands クラスのメンバを MenuCommand に追加し、MenuCommand を 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
[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.");
    }
}
   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."
 );
      }
   };
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
  System.ComponentModel.Design.StandardCommands
     System.Windows.Forms.Design.MenuCommands
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
StandardCommands メンバ
System.ComponentModel.Design 名前空間
MenuCommand クラス
CommandID クラス
IMenuCommandService インターフェイス

StandardCommands コンストラクタ


StandardCommands フィールド


パブリック フィールドパブリック フィールド

  名前 説明
パブリック フィールド AlignBottom AlignBottom コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignHorizontalCenters AlignHorizontalCenters コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignLeft AlignLeft コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignRight AlignRight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignToGrid AlignToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignTop AlignTop コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignVerticalCenters AlignVerticalCenters コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeBottom ArrangeBottom コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeIcons ArrangeIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeRight ArrangeRight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド BringForward BringForward コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド BringToFront BringToFront コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド CenterHorizontally CenterHorizontally コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド CenterVertically CenterVertically コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Copy Copy コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Cut Cut コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Delete Delete コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド DocumentOutline Document Outline コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド F1Help F1Help コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Group Group コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceConcatenate HorizSpaceConcatenate コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceDecrease HorizSpaceDecrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceIncrease HorizSpaceIncrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceMakeEqual HorizSpaceMakeEqual コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド LineupIcons LineupIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド LockControls LockControls コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド MultiLevelRedo MultiLevelRedo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド MultiLevelUndo MultiLevelUndo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Paste Paste コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Properties Properties コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド PropertiesWindow PropertiesWindow コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Redo Redo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Replace Replace コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SelectAll SelectAll コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SendBackward SendBackward コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SendToBack SendToBack コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ShowGrid ShowGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ShowLargeIcons ShowLargeIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControl SizeToControl コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControlHeight SizeToControlHeight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControlWidth SizeToControlWidth コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToFit SizeToFit コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToGrid SizeToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SnapToGrid SnapToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド TabOrder TabOrder コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Undo Undo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Ungroup Ungroup コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VerbFirst 一連の動詞の先頭を取得します。このフィールドは読み取り専用です。
パブリック フィールド VerbLast 一連の動詞の末尾を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceConcatenate VertSpaceConcatenate コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceDecrease VertSpaceDecrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceIncrease VertSpaceIncrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceMakeEqual VertSpaceMakeEqual コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ViewCode ViewCode コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ViewGrid ViewGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
参照参照

関連項目

StandardCommands クラス
System.ComponentModel.Design 名前空間
MenuCommand クラス
CommandID クラス
IMenuCommandService インターフェイス

StandardCommands メソッド


StandardCommands メンバ

ほとんどのアプリケーションで使用できる一連の標準コマンドの識別子を定義します。

StandardCommands データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド StandardCommands StandardCommands クラスの新しいインスタンスを初期化します。
パブリック フィールドパブリック フィールド
  名前 説明
パブリック フィールド AlignBottom AlignBottom コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignHorizontalCenters AlignHorizontalCenters コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignLeft AlignLeft コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignRight AlignRight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignToGrid AlignToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignTop AlignTop コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド AlignVerticalCenters AlignVerticalCenters コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeBottom ArrangeBottom コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeIcons ArrangeIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ArrangeRight ArrangeRight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド BringForward BringForward コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド BringToFront BringToFront コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド CenterHorizontally CenterHorizontally コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド CenterVertically CenterVertically コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Copy Copy コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Cut Cut コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Delete Delete コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド DocumentOutline Document Outline コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド F1Help F1Help コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Group Group コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceConcatenate HorizSpaceConcatenate コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceDecrease HorizSpaceDecrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceIncrease HorizSpaceIncrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド HorizSpaceMakeEqual HorizSpaceMakeEqual コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド LineupIcons LineupIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド LockControls LockControls コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド MultiLevelRedo MultiLevelRedo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド MultiLevelUndo MultiLevelUndo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Paste Paste コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Properties Properties コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド PropertiesWindow PropertiesWindow コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Redo Redo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Replace Replace コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SelectAll SelectAll コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SendBackward SendBackward コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SendToBack SendToBack コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ShowGrid ShowGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ShowLargeIcons ShowLargeIcons コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControl SizeToControl コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControlHeight SizeToControlHeight コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToControlWidth SizeToControlWidth コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToFit SizeToFit コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SizeToGrid SizeToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド SnapToGrid SnapToGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド TabOrder TabOrder コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Undo Undo コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド Ungroup Ungroup コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VerbFirst 一連の動詞の先頭を取得します。このフィールドは読み取り専用です。
パブリック フィールド VerbLast 一連の動詞の末尾を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceConcatenate VertSpaceConcatenate コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceDecrease VertSpaceDecrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceIncrease VertSpaceIncrease コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド VertSpaceMakeEqual VertSpaceMakeEqual コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ViewCode ViewCode コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック フィールド ViewGrid ViewGrid コマンドの CommandID を取得します。このフィールドは読み取り専用です。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

StandardCommands クラス
System.ComponentModel.Design 名前空間
MenuCommand クラス
CommandID クラス
IMenuCommandService インターフェイス



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「StandardCommands」の関連用語

StandardCommandsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



StandardCommandsのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS