MenuCommandService.FindCommand Method

Definition

Searches for the MenuCommand associated with the given command ID.

Overloads

FindCommand(CommandID)

Searches for the MenuCommand associated with the given command ID.

FindCommand(Guid, Int32)

Searches for the MenuCommand associated with the given command.

FindCommand(CommandID)

Source:
MenuCommandService.cs
Source:
MenuCommandService.cs
Source:
MenuCommandService.cs

Searches for the MenuCommand associated with the given command ID.

C#
public System.ComponentModel.Design.MenuCommand FindCommand(System.ComponentModel.Design.CommandID commandID);
C#
public System.ComponentModel.Design.MenuCommand? FindCommand(System.ComponentModel.Design.CommandID commandID);

Parameters

commandID
CommandID

The CommandID to find.

Returns

The MenuCommand associated with the given command; otherwise, null if the command is not found.

Implements

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

FindCommand(Guid, Int32)

Source:
MenuCommandService.cs
Source:
MenuCommandService.cs
Source:
MenuCommandService.cs

Searches for the MenuCommand associated with the given command.

C#
protected System.ComponentModel.Design.MenuCommand FindCommand(Guid guid, int id);
C#
protected System.ComponentModel.Design.MenuCommand? FindCommand(Guid guid, int id);

Parameters

guid
Guid

The GUID of the command.

id
Int32

The ID of the command.

Returns

The MenuCommand associated with the given command; otherwise, null if the command is not found.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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