Share via


ApplicationMenu 元素

代表 [應用程式] 功能表

使用方式

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

屬性

屬性 類型 必要 Description
CommandName
xs:positiveInteger 或 xs:string
No
將專案與 Command產生關聯。

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

子元素

元素 Description
ApplicationMenu.RecentItems
最多可能發生一次

MenuGroup
可能發生一或多次

父元素

元素
Ribbon.ApplicationMenu

備註

必要。

每個 Ribbon.ApplicationMenu必須剛好發生一次。

ApplicationMenu元素的子項目必須依指定的順序發生:

  1. ApplicationMenu.RecentItems
  2. MenuGroup

範例

下列範例示範 應用程式功能表的基本標記。

此程式碼區段會顯示 ApplicationMenu 命令宣告。

<!-- Command declarations for the Application Menu. -->
<Command Name="cmdFileMenu"
         Symbol="ID_FILE_MENU"
         Id="25000" />
<!-- Command declaration for most recently used items. -->
<Command Name="cmdMRUItems"
         Symbol="ID_FILE_MRUITEMS"
         Id="25050"/>
<!-- Command declarations for Application Menu items. -->
<Command Name="cmdNew"
         Symbol="ID_FILE_NEW"
         Comment="New"
         Id="25001"
         LabelTitle="&amp;New"/>
<Command Name="cmdOpen"
         Symbol="ID_FILE_OPEN"
         Comment="Open"
         Id="25002"
         LabelTitle="&amp;&amp;Open"/>
<Command>
  <Command.Name>cmdSave</Command.Name>
  <Command.Symbol>ID_FILE_SAVE</Command.Symbol>
  <Command.Comment>Save</Command.Comment>
  <Command.Id>25003</Command.Id>
  <Command.LabelTitle>
    <String>
      <String.Content>Label for Save</String.Content>
      <String.Id>59999</String.Id>
      <String.Symbol>strSave</String.Symbol>
    </String>
  </Command.LabelTitle>
  <Command.TooltipTitle>Tooltip title with &amp;&amp; for Save Command</Command.TooltipTitle>
  <Command.TooltipDescription>Tooltip description for Save Command.</Command.TooltipDescription>
  <Command.Keytip>s1</Command.Keytip>
</Command>
<Command Name="cmdPrint"
         Symbol="ID_FILE_PRINT"
         Comment="Save"
         Id="25004"
         LabelTitle="Print" />
<Command Name="cmdExit"
         Symbol="ID_FILE_EXIT"
         Comment="Exit"
         Id="25005"
         LabelTitle="Exit" />

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

<!-- Control declarations for Application Menu items. -->
<Ribbon.ApplicationMenu>
  <ApplicationMenu CommandName="cmdFileMenu">
    <!-- Most recently used items collection. -->
    <ApplicationMenu.RecentItems>
      <RecentItems CommandName="cmdMRUItems"/>
    </ApplicationMenu.RecentItems>
    <!-- Menu items collection. -->
    <MenuGroup>
      <Button CommandName="cmdNew" />
      <Button CommandName="cmdOpen" />
      <Button CommandName="cmdSave" />
    </MenuGroup>
    <MenuGroup>
      <Button CommandName="cmdPrint" />
      <Button CommandName="cmdExit" />
    </MenuGroup>
  </ApplicationMenu>
</Ribbon.ApplicationMenu>

項目資訊

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

另請參閱

應用程式功能表控制項