Skip to content

Latest commit

 

History

History
87 lines (73 loc) · 3.23 KB

commands-element.md

File metadata and controls

87 lines (73 loc) · 3.23 KB
titledescriptionms.datems.topicf1_keywordshelpviewer_keywordsauthorms.authormanagerms.subservice
Commands Element
The Commands element represents the collection of commands on the VSPackage toolbar and can have these sections: menus, groups, buttons, combos, and bitmaps.
11/04/2016
reference
Commands
Commands element (VSCT XML schema)
VSCT XML schema elements, Commands
maiak
maiak
mijacobs
extensibility-integration

Commands element

Represents the collection of commands on the VSPackage toolbar. The collection can have up to five subsections, as follows: menus, groups, buttons, combos, and bitmaps.

Each subsection child element, for example, <Menu>, is identified by a unique command ID that is a GUID and numeric identifier pair. The GUID identifies the "command set" and is used to group logically related commands. The VSPackage should define its own command set to avoid collisions with command IDs that are defined by other VSPackages.

Syntax

<Commandspackage="GuidMyPackage" > <Menus>... </Menus> <Groups>... </Groups> <Buttons>... </Buttons> <Combos>... </Combos> <Bitmaps>... </Bitmaps> </Commands>

Attributes and elements

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

Attributes

AttributeDescription
packageA GUID that identifies the VSPackage that provides the commands.

For example, package="guidVsPackage1Pkg".

Child elements

ElementDescription
Menus elementDefines all the menus that a VSPackage implements.
Groups elementContains entries that define the command groups in a VSPackage.
Buttons elementGroups Button elements.
Bitmaps elementGroups Bitmap elements.
Combos elementGroups Combo elements.

Parent elements

ElementDescription
CommandTable elementDefines all the elements that represent the commands that a VSPackage provides to the IDE. Possible elements are menu items, menus, toolbars, and combo boxes.

Example

The following example shows how to use a Commands Element.

<Commands package="guidMyPackage"> <Menus> <Menu Condition="'%(DEBUG)' != 'true'" guid="cmdSetGuidMyProductCommands" id="menuIDMainMenu" priority="0x0000" type="Menu"> <Annotation> <Documentation>this is an annotation</Documentation> <AppInfo> <CustomData> <CustomSubElement>Some data</CustomSubElement> </CustomData> </AppInfo> </Annotation> <CommandFlag>AlwaysCreate</CommandFlag> <Strings> <ButtonText>MainMenu</ButtonText> </Strings> </Menu> </Menus> <Commands> 

See also

close