Élément ApplicationMenu
Représente le menu Application.
Utilisation
<ApplicationMenu
CommandName = "xs:positiveInteger or xs:string"
>
child elements
</ApplicationMenu>
Attributs
Attribut | Type | Obligatoire | Description |
---|---|---|---|
CommandName |
xs:positiveInteger ou xs:string |
Non |
Associe l’élément à une commande. La valeur doit être unique dans le document XML du ruban. Longueur maximale : 100 caractères. |
Éléments enfants
Élément | Description |
---|---|
ApplicationMenu.RecentItems |
Peut se produire au plus une fois |
MenuGroup |
Peut se produire une ou plusieurs fois |
Éléments parents
Élément |
---|
Ribbon.ApplicationMenu |
Notes
Obligatoire.
Doit se produire exactement une fois pour chaque Ribbon.ApplicationMenu.
Les éléments enfants de l’élément ApplicationMenu doivent se produire dans l’ordre spécifié :
Exemples
L’exemple suivant illustre le balisage de base pour le menu Application.
Cette section de code présente les déclarations de la commande 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="&New"/>
<Command Name="cmdOpen"
Symbol="ID_FILE_OPEN"
Comment="Open"
Id="25002"
LabelTitle="&&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 && 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" />
Cette section de code présente les déclarations de contrôle 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>
Informations sur les éléments
- Système minimum pris en charge : Windows 7
- Peut être vide : Non
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour