Elemento ApplicationMenu

Representa el menú Aplicación.

Uso

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

Atributos

Atributo Tipo Obligatorio Descripción
CommandName
xs:positiveInteger o xs:string
No
Asocia el elemento a un objeto Command.

(xs:positiveInteger o xs:string)
Una cadena, un valor entero entre 2 y 59999, inclusive o un valor hexadecimal entre 0x2 y 0xea5f, ambos incluidos.
El valor debe ser único dentro del documento XML de la cinta de opciones.
Longitud máxima: 100 caracteres.

Elementos secundarios

Elemento Descripción
ApplicationMenu.RecentItems
Puede producirse como máximo una vez

MenuGroup
Puede producirse una o varias veces

Elementos primarios

Elemento
Ribbon.ApplicationMenu

Comentarios

Necesario.

Debe producirse exactamente una vez para cada Ribbon.ApplicationMenu.

Los elementos secundarios del elemento ApplicationMenu deben producirse en el orden especificado:

  1. ApplicationMenu.RecentItems
  2. MenuGroup

Ejemplos

En el ejemplo siguiente se muestra el marcado básico para el menú aplicación.

En esta sección de código se muestran las declaraciones applicationMenu Command.

<!-- 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" />

En esta sección de código se muestran las declaraciones de control 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>

Información de elemento

  • Sistema mínimo admitido: Windows 7
  • Puede estar vacío: No

Consulte también

Control de menú de la aplicación