DropDownButton 元素

表示标准的 下拉按钮 控件。

使用情况

<DropDownButton
  ApplicationModes = "xs:string"
  CommandName = "xs:positiveInteger or xs:string">
  child elements
</DropDownButton>

特性

属性 类型 必选 说明
ApplicationModes
xs:string
否
仅当 MenuGroup 是父元素时有效。

(xs:string)
包含 0 到 31 之间的整数的逗号分隔列表的字符串。
空格有效,将被忽略。
最大长度:250 个字符。
CommandName
xs:positiveInteger 或 xs:string
否
将 元素与 命令相关联。

(xs:positiveInteger 或 xs:string)
字符串、介于 2 和 59999 之间的整数值(非独占)或 0x2 与 0xea5f 之间的十六进制值(含)。
该值在功能区 XML 文档中必须是唯一的。
最大长度:100 个字符。

子元素

元素 说明
Button
可能发生一次或多次

CheckBox
可能发生一次或多次

ComboBox
可能发生一次或多次

DropDownButton
可能发生一次或多次

DropDownColorPicker
可能发生一次或多次

DropDownGallery
可能发生一次或多次

MenuGroup
必须至少发生一次

SplitButton
可能发生一次或多次

SplitButtonGallery
可能发生一次或多次

ToggleButton
可能发生一次或多次

父元素

元素
ControlGroup
DropDownButton
DropDownGallery
组
MenuGroup
SplitButton
SplitButtonGallery

备注

可选或必需,具体取决于父元素。

对于每个 ControlGroup、 DropDownButton、 DropDownGallery、 Group、 MenuGroup、 SplitButton 或 SplitButtonGallery 元素,可能会出现一次或多次。

DropDownButton 支持 在应用程序 菜单的左侧列中托管应用程序模式。

当 DropDownButton 是 ApplicationMenu 的后代时,DropDownGallery 和 SplitButtonGallery 不是 DropDownButton 的有效子元素。

示例

以下示例演示 DropDownButton 的基本标记。

此部分代码显示 DropDownButton 命令声明,其中包含一个关联的 Group,该 组 充当 DropDownButton 元素的父容器。

<!-- DropDownButton -->
<Command Name="cmdDropDownButtonGroup"
         Symbol="cmdDropDownButtonGroup"
         Comment="DropDownButton Group"
         LabelTitle="DropDownButton"/>
<Command Name="cmdDropDownButton"
         Symbol="cmdDropDownButton"
         Comment="DropDownButton"
         LabelTitle="DropDownButton"/>
<Command Name="cmdDDBButton1"
         Symbol="cmdDDBButton1"
         Comment="DDBButton1"
         LabelTitle="DDB Button"/>
<Command Name="cmdDDBColorPicker"
         Symbol="cmdDDBColorPicker"
         Comment="DDBColorPicker"
         LabelTitle="DDB ColorPicker"/>

此部分代码显示 DropDownButton 控件声明。

<Group CommandName="cmdDropDownButtonGroup">
  <DropDownButton CommandName="cmdDropDownButton">
    <MenuGroup>
      <Button CommandName="cmdDDBButton1"/>
      <DropDownColorPicker CommandName="cmdDDBColorPicker"/>
    </MenuGroup>
  </DropDownButton>
</Group>

元素信息

  • 支持的最低系统:Windows 7
  • 可以为空:否

另请参阅

下拉按钮控件

SetModes