SplitButton 元素

表示標準 分割按鈕 控制項。

使用方式

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

屬性

屬性 類型 必要 描述
ApplicationModes
xs:string

只有在 MenuGroup 是父元素時才有效。

(xs:string)
字串,包含介於 0 到 31 之間的逗號分隔整數清單。
空白字元有效且忽略。
最大長度:250 個字元。
CommandName
xs:positiveInteger 或 xs:string

將專案與 Command產生關聯。

(xs:positiveInteger 或 xs:string)
字串、介於 2 到 59999 之間的整數值,包含,或包含0x2與0xea5f之間的十六進位值。
值在功能區 XML 檔中必須是唯一的。
最大長度:100 個字元。

子元素

元素 描述
Button
可能會發生一或多次

CheckBox
可能會發生一或多次

DropDownButton
可能會發生一或多次

DropDownColorPicker
可能會發生一或多次

DropDownGallery
可能會發生一或多次

SplitButton
可能會發生一或多次

SplitButton.ButtonItem
最多可能發生一次

SplitButton.MenuGroups
最多可能發生一次

SplitButtonGallery
可能會發生一或多次

ToggleButton
可能會發生一或多次

父元素

元素
ControlGroup
DropDownGallery
群組
MenuGroup
SplitButton
SplitButtonGallery

備註

選擇性。

每個ControlGroupDropDownGalleryGroupMenuGroupSplitButton 或 SplitButtonGallery元素可能會發生一或多次。

當 SplitButton 裝載于應用程式功能表左側資料行時,SplitButton 支援 應用程式模式

DropDownButtonApplicationMenu的子系時,DropDownGallerySplitButtonGallery不是DropDownButton的有效子項目。

如果下列專案不存在為SplitButton的子項目,則SplitButton.MenuGroups必須發生一次:

這些控制項會被視為單一預設 SplitButton.MenuGroups 元素的 子項目。

範例

下列範例示範 分割按鈕的基本標記。

此區段程式碼會顯示 SplitButton 命令宣告,其相關聯的 Group 會作為 SplitButton 元素的父容器。

<!-- SplitButton -->
<Command Name="cmdSplitButtonGroup"
         Symbol="cmdSplitButtonGroup"
         Comment="SplitButton Group"
         LabelTitle="SplitButton"/>
<Command Name="cmdSplitButton"
         Symbol="cmdSplitButton"
         Comment="SplitButton"
         LabelTitle="SplitButton"/>
<Command Name="cmdSBButtonItem"
         Symbol="cmdSBButtonItem"
         Comment="SBButtonItem"
         LabelTitle="SB ButtonItem"/>
<Command Name="cmdSBButton1"
         Symbol="cmdSBButton1"
         Comment="SBButton1"
         LabelTitle="SB Button">
  <Command.LargeImages>
    <Image Source="res/copyL_32.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/copyS_16.bmp"/>
  </Command.SmallImages>
  <Command.LargeHighContrastImages>
    <Image Source="res/copyLHC_32.bmp"/>
  </Command.LargeHighContrastImages>
  <Command.SmallHighContrastImages>
    <Image Source="res/copySHC_16.bmp"/>
  </Command.SmallHighContrastImages>
</Command>
<Command Name="cmdSBMajorItems"
         Comment="Major Items Category"
         LabelTitle="Major Items"/>
<Command Name="cmdSBStandardItems"
         Comment="Standard Items Category"
         LabelTitle="Standard Items"/>

此程式碼區段會顯示 SplitButton 控制項宣告。

<Group CommandName="cmdSplitButtonGroup">
  <SplitButton CommandName="cmdSplitButton">
    <SplitButton.ButtonItem>
      <Button CommandName="cmdSBButtonItem"/>
    </SplitButton.ButtonItem>
    <SplitButton.MenuGroups>
      <MenuGroup CommandName="cmdSBMajorItems" 
                 Class="MajorItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup CommandName="cmdSBStandardItems"
                 Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
      <MenuGroup Class="StandardItems">
        <Button CommandName="cmdSBButton1"/>
        <Button CommandName="cmdSBButton1"/>
      </MenuGroup>
    </SplitButton.MenuGroups>
  </SplitButton>
</Group>

項目資訊

  • 最低支援的系統:Windows 7
  • 可以是空的:否

另請參閱

分割按鈕控制項

SetModes