Button 元素
定义用户可以与之交互的元素。 有四个按钮,如下所示:按钮、 MenuButton、 SplitDropDown 和样片。
<Button guid="guidMyCommandSet" id="MyCommand" priority="0x102" type="button">
<Parent>... </Parent>
<Icon>... </Icon>
<CommandFlag>... </CommandFlag>
<Strings>... </Strings>
</Button>
特性和元素
以下几节描述了特性、子元素和父元素。
特性
特性 |
说明 |
---|---|
GUID |
必选。 GUID/ID 订单标识符的 GUID。 |
id |
必选。 GUID/ID 命令 ID 的 ID。 |
priority |
可选。 指定优先级的数值。 |
type |
可选。 指定该按钮的枚举值。 如果未指定,使用按。
|
Condition |
可选。 请参见 VSCT XML 架构条件特性。 |
子元素
元素 |
说明 |
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
可选。 按钮的父元素。 |
|||||||||||||||||||||||||||
可选。 图标与按钮。 |
|||||||||||||||||||||||||||
必选。 按钮的有效 CommandFlag 值如下所示。
|
|||||||||||||||||||||||||||
必选。 子 ButtonText 元素 必须定义。 |
|||||||||||||||||||||||||||
批注 |
可选注释。 |
父元素
元素 |
说明 |
---|---|
组按钮元素。 |
示例
下面的示例定义了 .vsct 文件的按钮。
<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>