MenuCommandService Class

Implements the IMenuCommandService interface.

Namespace: System.ComponentModel.Design
Assembly: System.Design (in

public class MenuCommandService : IMenuCommandService, IDisposable
public class MenuCommandService implements IMenuCommandService, IDisposable
public class MenuCommandService implements IMenuCommandService, IDisposable
Not applicable.

The MenuCommandService class implements the IMenuCommandService interface, which is the managed interface used to add handlers for menu commands and to define verbs.

The MenuCommandService class is automatically offered by the package class to offer global commands for an entire package, and it is also offered by the Microsoft.VisualStudio.Shell.WindowPane class to offer commands for the current window. This offering is always done through the service container, so anyone deriving from the package or window pane classes can remove or replace the default implementation of the IMenuCommandService interface.

The MenuCommandService class utilizes several other services. All of these services are optional, so the behavior of the MenuCommandService class degrades if one or more services are missing. The following table shows which services are used and for what purpose.




Used to discover the current selection in order to obtain verbs offered by the currently selected designer.


Used to obtain the designer for the currently selected component, if any.


Used to notify Visual Studio that the command status has changed.


Used to show context menus.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions