Button Element

Defines an element that the user can interact with. There are four kinds of Buttons, as follows: Button, MenuButton, SplitDropDown, and Swatch.

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.

Button

A standard command that appears on toolbars (typically as an iconic button), menus, and context menus.

MenuButton

A menu item that does not execute a command, but produces another menu.

SplitDropDown

Controls, such as the Undo and Redo buttons on the standard toolbar in Microsoft Word.

Swatch

Controls that display color choices, such as those in a font color dialog box. Requires the implementation of some underlying interfaces.

Condition

Optional. See VSCT XML Schema Conditional Attributes.

Child Elements

Element

Description

Parent

Optional. The parent element of the button.

Icon

Optional. The icon associated with the button.

CommandFlag

Required. See Command Flag Element. The valid CommandFlag values for a Button are as follows.

AllowParams

CommandWellOnly

DefaultDisabled

DefaultInvisible

DontCache

DynamicItemStart

DynamicVisibility

FixMenuController

IconAndText

NoButtonCustomize

NoCustomize

NoKeyCustomize

NoShowOnMenuController

Pict

PostExec

ProfferedCmd

RouteToDocs

TextCascadeUseBtn

TextMenuUseButton

TextChanges

TextChangesButton

TextContextUseButton

TextMenuCtrlUseMenu

TextMenuUseButton

TextOnly

Strings

Required. See Strings Element. The child ButtonText element must be defined.

Annotation

Optional comment.

Parent Elements

Element

Description

Buttons Element

Groups Button elements.

Example

<Button guid="cmdSetGuidMyProductCommands" id="cmdidAddWidget"
  priority="0x0040" type="Button">
  <Parent guid="cmdSetGuidWidgetCommands" id="groupIDFileEdit">
  <Icon guid="guidWidgetIcons" id="2"/>
  <CommandFlag>DefaultInvisible</CommandFlag>
  <CommandFlag>DynamicVisibility</CommandFlag>
  <Strings>
    <ButtonText>&amp;Add Widgit</ButtonText>
  </Strings>
</Button>

See Also

Other Resources

Visual Studio Command Table (.Vsct) Files