共用方式為


CommandPlacement 元素

CommandPlacement 元素可讓按鈕、群組和功能表包含在多個群組或功能表中。 藉由使用 CommandPlacement 元素,您不需要完全重新定義這些專案,即可修改使用者介面的外觀。

如需詳細資訊,請參閱 建立可重複使用的按鈕群組。

語法

<CommandPlacement guid="guidMyCommandSet" id="MyCommand" priority="0x001" >
  <Parent>... </Parent>
</CommandPlacement>

屬性和元素

下列章節說明屬性、子元素和父元素。

屬性

屬性 描述
guid 必要。 命令集的 guid,如 Symbols 元素中所定義。
id 必要。 要放置之功能表、群組或命令的標識碼,如中所 Symbols Element定義。
priority 必要。 決定專案在其父元素中的視覺位置。
Condition 選擇性。 請參閱 條件屬性

子元素

元素 描述
上層 必要。 裝載要放置之專案的功能表或群組。

父項目

元素 描述
CommandPlacements 元素 指定 CommandPlacements 和 CommandPlacement 元素的群組。

範例

<CommandPlacements>
  <CommandPlacement guid="guidWidgetPackage" id="cmdidInsertOptions"
    priority="0x0300">
    <Parent guid="cmdGuidWidgetCommands" id="menuIDEditWidget"/>
  </CommandPlacement>
</CommandPlacements>

另請參閱