MenuCommandService.AddCommand(MenuCommand) 方法

定義

為選單指令服務新增指令處理器。

public:
 virtual void AddCommand(System::ComponentModel::Design::MenuCommand ^ command);
public virtual void AddCommand(System.ComponentModel.Design.MenuCommand command);
abstract member AddCommand : System.ComponentModel.Design.MenuCommand -> unit
override this.AddCommand : System.ComponentModel.Design.MenuCommand -> unit
Public Overridable Sub AddCommand (command As MenuCommand)

參數

command
MenuCommand

還有 MenuCommand 一點要補充。

實作

例外狀況

commandnull

指令處理器 command 已經存在。

備註

AddCommand 方法在選單指令服務中新增了一個指令處理器。 指令處理器不定義選單項目的文字、捷徑或位置。 相反地,它們定義了當項目被點擊時,選單項目的行為。

適用於

另請參閱