CommandPlacement Element

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CommandPlacement Element.

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.

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

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

Attributes

AttributeDescription
guidRequired. The guid of the command set, as defined in the Symbols Element.
idRequired. The id of the menu, group, or command to be placed, as defined in the Symbols Element.
priorityRequired. Determines the visual position of the item in its parent element.
ConditionOptional. See Conditional Attributes.

Child Elements

ElementDescription
ParentRequired. The menu or group that hosts the item to be placed.

Parent Elements

ElementDescription
CommandPlacements ElementSpecifies groups of CommandPlacements and CommandPlacement elements.
<CommandPlacements>  
  <CommandPlacement guid="guidWidgetPackage" id="cmdidInsertOptions"  
    priority="0x0300">  
    <Parent guid="cmdGuidWidgetCommands" id="menuIDEditWidget"/>  
  </CommandPlacement>  
</CommandPlacements>  

CommandPlacements Element
Visual Studio Command Table (.Vsct) Files

Show: