次の方法で共有


CommandPlacement Element

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The CommandPlacement element enables buttons, groups, and menus to be included in more than one group or menu. By using the CommandPlacement element, you do not have to completely redefine these items in order to modify the look of a user interface.

For more information, see Creating Reusable Groups of Buttons.

Syntax

<CommandPlacement guid=guidMyCommandSet" id="MyCommand" priority="0x001" >  
  <Parent>... </Parent>  
</CommandPlacement>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
guid Required. The guid of the command set, as defined in the Symbols Element.
id Required. The id of the menu, group, or command to be placed, as defined in the Symbols Element.
priority Required. Determines the visual position of the item in its parent element.
Condition Optional. See Conditional Attributes.

Child Elements

Element Description
Parent Required. The menu or group that hosts the item to be placed.

Parent Elements

Element Description
CommandPlacements Element Specifies groups of CommandPlacements and CommandPlacement elements.

Example

<CommandPlacements>  
  <CommandPlacement guid="guidWidgetPackage" id="cmdidInsertOptions"  
    priority="0x0300">  
    <Parent guid="cmdGuidWidgetCommands" id="menuIDEditWidget"/>  
  </CommandPlacement>  
</CommandPlacements>  

See Also

CommandPlacements Element
Visual Studio Command Table (.Vsct) Files