MenuCommandService.AddCommand(MenuCommand) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為選單指令服務新增指令處理器。
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 一點要補充。
實作
例外狀況
command 是 null。
指令處理器 command 已經存在。
備註
此 AddCommand 方法在選單指令服務中新增了一個指令處理器。 指令處理器不定義選單項目的文字、捷徑或位置。 相反地,它們定義了當項目被點擊時,選單項目的行為。