DropDownColorPicker 元素

代表下 拉式色彩選擇器控制項,當按一下時,會顯示色板的色板。

使用方式

<DropDownColorPicker
  CommandName = "xs:positiveInteger or xs:string"
  Columns = "xs:positiveInteger"
  ThemeColorGridRows = "xs:positiveInteger"
  StandardColorGridRows = "xs:positiveInteger"
  RecentColorGridRows = "xs:positiveInteger"
  IsAutomaticColorButtonVisible = "Boolean"
  IsNoColorButtonVisible = "Boolean"
  ColorTemplate = "xs:string"
  ChipSize = "xs:string"/>

屬性

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

每個色彩晶片或色板的大小。
限制為下列其中一個值:

(Small)
每個色彩晶片都是 11x11 圖元方形。
(中)
每個色彩晶片都是 16x16 圖元方形。
(大型)
每個色彩晶片都是 24x24 圖元方形。
ColorTemplate
xs:string

指定下 拉式選擇器類型的版面配置範本。
如果未宣告 任何與 ColorTemplate 相關的選擇性屬性,則預設檢視會顯示) 下列其中一個 (值:

(ThemeColors)
預設值。
DropDownColorPicker 元素的螢幕擷取畫面,其中 ColorTemplate 屬性設定為 'ThemeColors'。
設定 ColorTemplate 屬性以 ThemeColors 啟用下列功能:
  • SplitButton 錨點。
  • 預設會顯示自動色彩按鈕。
  • Windows 主題色彩 的監看式格線。
  • 標準色彩 的監看式格線。
  • 最近的色彩 監看式格線是選擇性的。
  • 更多色彩 對話方塊啟動器。
  • 預設不會顯示色彩色彩按鈕。
(StandardColors)
DropDownColorPicker 元素的螢幕擷取畫面,其中 ColorTemplate 屬性設定為 'StandardColors'。
設定 ColorTemplate 屬性以 StandardColors 啟用下列功能:
  • SplitButton 錨點。
  • 預設會顯示自動色彩按鈕。
  • 標準色彩 的監看式格線。
  • 更多色彩 對話方塊啟動器。
  • 預設不會顯示色彩色彩按鈕。
(HighlightColors)
DropDownColorPicker 元素的螢幕擷取畫面,其中 ColorTemplate 屬性設定為 'HighlightColors'。
設定 ColorTemplate 屬性以 HighlightColors 啟用下列功能:
  • SplitButton 錨點。
  • 標準色彩 的監看式格線沒有標頭。
  • 預設不會顯示色彩色彩按鈕。
資料行
xs:positiveInteger

色板 (或) 欄的色板數目。

(xs:positiveInteger)
包含 1 到 256 之間的任何正整數值。
CommandName
xs:positiveInteger 或 xs:string

將專案與 Command產生關聯。

(xs:positiveInteger 或 xs:string)
字串、介於 2 到 59999 之間的整數值,包含,或包含0x2與0xea5f之間的十六進位值。
值在功能區 XML 檔中必須是唯一的。
最大長度:100 個字元。
IsAutomaticColorButtonVisible
Boolean
No
顯示 (或隱藏 [ 自動 色彩] 按鈕) 。
只有在為ColorTemplate屬性指定 或 ThemeColors 時才 StandardColors 有效。
限制為下列其中一個值, (0 和 1 無效) :

(true)
(false)
IsNoColorButtonVisible
Boolean
No
顯示 (或隱藏) [無色彩 ] 按鈕。
適用于所有 ColorTemplate 值。
限制為下列其中一個值, (0 和 1 無效) :

(true)
(false)
RecentColorGridRows
xs:positiveInteger

[ 最近使用色彩 ] 區域中的色彩晶片 (或) 列的色板數目。
只有在為ColorTemplate屬性指定時才 ThemeColors 有效。

(xs:positiveInteger)
包含 1 到 256 之間的任何正整數值。
StandardColorGridRows
xs:positiveInteger

標準色彩區域中 (或色板) 列的 色彩 晶片數目。

(xs:positiveInteger)
包含 1 到 256 之間的任何正整數值。
ThemeColorGridRows
xs:positiveInteger

主題色彩區域中 (或色板) 列的 色彩 晶片數目。
只有在為ColorTemplate屬性指定時才 ThemeColors 有效。

(xs:positiveInteger)
包含 1 到 256 之間的任何正整數值。

子元素

沒有子專案。

父元素

元素
ControlGroup
DropDownButton
DropDownGallery
群組
MenuGroup
SplitButton
SplitButtonGallery

備註

選擇性。

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

範例

下列範例示範所有三種下 拉式清單色彩選擇器類型的基本標記。

這一節程式碼會顯示三個 DropDownColorPicker 元素的 Command 宣告。

<!-- DropDownColorPickers -->
<Command Name="cmdDropDownColorPickerGroup"
         Symbol="cmdDropDownColorPickerGroup"
         Comment="DropDownColorPicker Group"
         Id="55000"/>
<Command Name="cmdDropDownColorPickerThemeColors"
         Symbol="cmdDropDownColorPickerThemeColors"
         Comment="DropDownColorPicker ThemeColors"
         Id="55010"
         LabelTitle="ThemeColors"
         LabelDescription="ThemeColors\ndescription."/>
<Command Name="cmdDropDownColorPickerStandardColors"
         Symbol="cmdDropDownColorPickerStandardColors"
         Comment="DropDownColorPicker StandardColors"
         Id="55011"
         LabelTitle="StandardColors"/>
<Command Name="cmdDropDownColorPickerHighlightColors"
         Symbol="cmdDropDownColorPickerHighlightColors"
         Comment="DropDownColorPicker HighlightColors"
         Id="55012"
         LabelTitle="HighlightColors"/>

這一節的程式碼會顯示三種類型的 DropDownColorPicker 控制項宣告。

<Group CommandName="cmdDropDownColorPickerGroup"
       SizeDefinition="ThreeButtons">
  <DropDownColorPicker
    CommandName="cmdDropDownColorPickerThemeColors"
    ColorTemplate="ThemeColors"/>
  <DropDownColorPicker
    CommandName="cmdDropDownColorPickerStandardColors"
    ColorTemplate="StandardColors"/>
  <DropDownColorPicker
    CommandName="cmdDropDownColorPickerHighlightColors"
    ColorTemplate="HighlightColors"
    StandardColorGridRows="1"/>
</Group>

項目資訊

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

另請參閱

下拉式清單色彩選擇器控制項

DropDownColorPicker 範例