SplitButtonGallery 元素

表示具有資源庫型下拉式功能表的 [分割按鈕庫 ] 控制項。

使用方式

<SplitButtonGallery
  ApplicationModes = "xs:string"
  CommandName = "xs:positiveInteger or xs:string"
  HasLargeItems = "Boolean"
  ItemHeight = "xs:integer"
  ItemWidth = "xs:integer"
  TextPosition = "TextPositionType"
  Type = "xs:string">
  child elements
</SplitButtonGallery>

屬性

屬性 類型 必要 描述
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 個字元。
HasLargeItems
Boolean
No
判斷命令的大型或小型影像資源是否顯示在資源庫控制項中。

注意:
僅適用于 類型 屬性的值等於 Command 的資源庫。


限制為下列其中一個值, (0 和 1 無效) :

(true)
預設值。
(false)
ItemHeight
xs:integer

(xs:integer)
預設值為 -1。
ItemWidth
xs:integer

(xs:integer)
預設值為 -1。
TextPosition
TextPositionType

限制為下列其中一個值:

(底部)
(隱藏)
左 ()
(重迭)
(Right)
(Top)
類型
xs:string

限制為下列其中一個值:

(專案)
(命令)

子元素

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

CheckBox
可能會發生一或多次

SplitButton
可能會發生一或多次

SplitButtonGallery.MenuGroups
必須只發生一次

SplitButtonGallery.MenuLayout
最多可能發生一次

ToggleButton
可能會發生一或多次

父元素

元素 描述
ControlGroup

MenuGroup
當包含在 ApplicationMenu中時。 只有第一層才支援這個專案,而且不能有子項目。

QuickAccessToolbar.ApplicationDefaults
注意:
Windows 8 和更新版本。



SplitButton

備註

選擇性。

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

SplitButtonGallery 支援 應用程式模式

UI_PKEY_BooleanValue 是由應用程式用來查詢 SplitButtonGallery按鈕控制項的切換狀態。

下列螢幕擷取畫面說明 Windows 7 Microsoft 小畫家的功能區分割按鈕庫控制項。

Microsoft paint for windows 7 中分割按鈕庫控制項的螢幕擷取畫面。

範例

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

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

<!-- SplitButtonGallery -->
<Command Name="cmdSplitButtonGalleryGroup"
         Symbol="cmdSplitButtonGalleryGroup"
         Comment="SplitButtonGallery Group"
         LabelTitle="SplitButtonGallery"/>
<Command Name="cmdSplitButtonGallery"
         Symbol="cmdSplitButtonGallery"
         Comment="SplitButtonGallery"
         LabelTitle="SplitButtonGallery"/>

這一節的程式碼會顯示 SplitButtonGallery 控制項宣告。

<!-- SplitButtonGallery -->
<Group CommandName="cmdSplitButtonGalleryGroup">
  <SplitButtonGallery CommandName="cmdSplitButtonGallery">
    <SplitButtonGallery.MenuLayout>
      <FlowMenuLayout Rows="2"
                      Columns="3"
                      Gripper="None"/>
    </SplitButtonGallery.MenuLayout>
    <SplitButtonGallery.MenuGroups>
      <MenuGroup>
        <Button CommandName="cmdButton1"></Button>
        <Button CommandName="cmdButton2"></Button>
      </MenuGroup>
      <MenuGroup>
        <Button CommandName="cmdButton3"></Button>
      </MenuGroup>
    </SplitButtonGallery.MenuGroups>
  </SplitButtonGallery>
</Group>

項目資訊

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

另請參閱

分割按鈕庫控制項

使用資源庫

SetModes

資源庫範例