Прочетете на английски Редактиране

Споделяне чрез


MenuCommandService.AddCommand(MenuCommand) Method

Definition

Adds a command handler to the menu command service.

C#
public virtual void AddCommand(System.ComponentModel.Design.MenuCommand command);

Parameters

command
MenuCommand

The MenuCommand to add.

Implements

Exceptions

command is null.

A command handler command already exists.

Remarks

The AddCommand method adds a command handler to the menu command service. Command handlers do not define the text, shortcut, or placement of a menu item. Rather, they define the menu item's behavior if the item is clicked.

Applies to

Продукт Версии
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9, 10

See also