Elemento ApplicationMenu

Rappresenta il menu applicazione.

Utilizzo

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

Attributi

Attributo Type Obbligatoria Descrizione
CommandName
xs:positiveInteger o xs:string
No
Associa l'elemento a un oggetto Command.

(xs:positiveInteger o xs:string)
Stringa, un valore intero compreso tra 2 e 59999, inclusi o un valore esadecimale compreso tra 0x2 e 0xea5f, inclusi.
Il valore deve essere univoco all'interno del documento XML della barra multifunzione.
Lunghezza massima: 100 caratteri.

Elementi figlio

Elemento Descrizione
ApplicationMenu.RecentItems
Può verificarsi al massimo una volta

Menugroup
Può verificarsi una o più volte

Elementi padre

Elemento
Ribbon.ApplicationMenu

Commenti

Obbligatorio.

Deve verificarsi una sola volta per ogni ribbon.ApplicationMenu.

Gli elementi figlio dell'elemento ApplicationMenu devono essere presenti nell'ordine specificato:

  1. ApplicationMenu.RecentItems
  2. Menugroup

Esempio

Nell'esempio seguente viene illustrato il markup di base per il menu applicazione.

Questa sezione di codice mostra le dichiarazioni del comando 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" />

Questa sezione di codice mostra le dichiarazioni di controllo 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>

Informazioni sull'elemento

  • Sistema minimo supportato: Windows 7
  • Può essere vuoto: No

Vedi anche

Controllo Menu applicazione