Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Defines an element that the user can interact with. Buttons can be of different kinds: Button, MenuButton, and SplitDropDown.
<Button guid="guidMyCommandSet" id="MyCommand" priority="0x102" type="button">
<Parent>... </Parent>
<Icon>... </Icon>
<CommandFlag>... </CommandFlag>
<Strings>... </Strings>
</Button>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
guid |
Required. GUID of the GUID/ID command identifier. |
id |
Required. ID of the GUID/ID command identifier. |
priority |
Optional. A numeric value that specifies the priority. |
type |
Optional. An enumerated value that specifies the kind of button. If not given, uses Button.
|
Condition |
Optional. See VSCT XML Schema Conditional Attributes. |
Child Elements
Element |
Description |
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Optional. The parent element of the button. |
|||||||||||||||||||||||||||
Optional. The icon associated with the button. |
|||||||||||||||||||||||||||
Required. The valid CommandFlag values for a Button are as follows.
|
|||||||||||||||||||||||||||
Required. The child ButtonText Element must be defined. |
|||||||||||||||||||||||||||
Annotation |
Optional comment. |
Parent Elements
Element |
Description |
---|---|
Groups Button elements. |
Example
The following example defines a button in a .vsct file.
<Button guid="guidMenuTextCmdSet" id="cmdidMyCommand" priority="0x0100" type="Button">
<Parent guid="guidMenuTextCmdSet" id="MyMenuGroup" />
<Icon guid="guidImages" id="bmpPic1" />
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<CommandName>cmdidMyCommand</CommandName>
<ButtonText>My Command name</ButtonText>
</Strings>
</Button>