Elemento ApplicationMenu

Representa o Menu do Aplicativo.

Uso

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

Atributos

Atributo Type Obrigatório Descrição
CommandName
xs:positiveInteger ou xs:string
Não
Associa o elemento a um Command.

(xs:positiveInteger ou xs:string)
Uma cadeia de caracteres, um valor inteiro entre 2 e 59999, inclusive ou um valor hexadecimal entre 0x2 e 0xea5f, inclusive.
O valor deve ser exclusivo no documento XML da Faixa de Opções.
Comprimento máximo: 100 caracteres.

Elementos filho

Elemento Descrição
ApplicationMenu.RecentItems
Pode ocorrer no máximo uma vez

Menugroup
Pode ocorrer uma ou mais vezes

Elementos pai

Elemento
Ribbon.ApplicationMenu

Comentários

Obrigatórios.

Deve ocorrer exatamente uma vez para cada Ribbon.ApplicationMenu.

Os elementos filho do elemento ApplicationMenu devem ocorrer na ordem especificada:

  1. ApplicationMenu.RecentItems
  2. Menugroup

Exemplos

O exemplo a seguir demonstra a marcação básica para o Menu do Aplicativo.

Esta seção de código mostra as declarações do 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" />

Esta seção de código mostra as declarações de controle 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>

Informações do elemento

  • Sistema mínimo com suporte: Windows 7
  • Pode estar vazio: Não

Confira também

Controle de Menu do Aplicativo