DropDownGallery 元素

代表具有資源庫型功能表的 下拉式資源庫 控制項。

使用方式

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

屬性

屬性 類型 必要 描述
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
可能會發生一或多次

DropDownGallery.MenuGroups
必須只發生一次

DropDownGallery.MenuLayout
最多可能發生一次

SplitButton
可能會發生一或多次

ToggleButton
可能會發生一或多次

父元素

元素 描述
ControlGroup

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

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



SplitButton

備註

選擇性。

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

DropDownGallery 支援 應用程式模式

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

microsoft paint for windows 7 中下拉式資源庫控制項的螢幕擷取畫面。

範例

下列範例示範 DropDownGallery的基本標記。

此程式碼區段顯示DropDownGallery命令宣告,以及做為DropDownGallery元素父容器的相關聯Group

<!-- DropDownGallery -->
<Command Name="cmdDropDownGalleryGroup"
         Symbol="cmdDropDownGalleryGroup"
         Comment="DropDownGallery Group"
         LabelTitle="DropDownGallery"/>
<Command Name="cmdDropDownGallery"
         Symbol="cmdDropDownGallery"
         Comment="DropDownGallery"
         LabelTitle="DropDownGallery"/>

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

<!-- DropDownGallery -->
<Group CommandName="cmdDropDownGalleryGroup">
  <DropDownGallery CommandName="cmdDropDownGallery"
                   TextPosition="Hide"
                   Type="Commands"
                   ItemHeight="32"
                   ItemWidth="32">
    <DropDownGallery.MenuLayout>
      <FlowMenuLayout Rows="2"
                      Columns="3"
                      Gripper="None"/>
    </DropDownGallery.MenuLayout>
    <DropDownGallery.MenuGroups>
      <MenuGroup>
        <Button CommandName="cmdButton1"></Button>
        <Button CommandName="cmdButton2"></Button>
       </MenuGroup>
       <MenuGroup>
        <Button CommandName="cmdButton3"></Button>
      </MenuGroup>
    </DropDownGallery.MenuGroups>
  </DropDownGallery>
</Group>

項目資訊

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

另請參閱

下拉式資源庫控制項

使用資源庫

SetModes

資源庫範例