Share via


Tab (élément)

Représente un onglet principal ou contextuel .

Utilisation

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

Attributs

Attribut Type Obligatoire Description
ApplicationModes
xs:string
Non
Valide uniquement si MenuGroup est l’élément parent.

(xs:string)
Chaîne qui contient une liste séparée par des virgules d’entiers compris entre 0 et 31.
L’espace blanc est valide et ignoré.
Longueur maximale : 250 caractères.
CommandName
xs:positiveInteger ou xs:string
Non
Associe l’élément à une commande.

(xs:positiveInteger ou xs:string)
Une chaîne, une valeur entière comprise entre 2 et 59999, inclusive, ou une valeur hexadécimale comprise entre 0x2 et 0xea5f, inclusive.
La valeur doit être unique dans le document XML du ruban.
Longueur maximale : 100 caractères.

Éléments enfants

Élément Description
Groupe
Peut se produire une ou plusieurs fois

Tab.ScalingPolicy
Peut se produire au plus une fois

Éléments parents

Élément
Ribbon.Tabs
TabGroup

Notes

Obligatoire.

Doit se produire au moins une fois pour chaque élément Ribbon.Tabs ou TabGroup .

L’onglet prend en charge les modes d’application.

Si ScalingPolicy.IdealSizes est présent pour l’élément Tab , une entrée pour chaque élément Group et sa taille idéale sont requises sous ScalingPolicy.IdealSizes.

Exemples

L’exemple suivant illustre le balisage de base pour l’élément Tab .

Cette section de code affiche les déclarations de la commande Tab pour un onglet Accueil .

<Command Name="cmdHomeTab"
         LabelTitle="Home"
         Keytip="H" />
<Command Name="cmdClipboardGroup"
         Symbol="IDR_CMD_CLIPBOARD"
         Id="10000"
         Comment="Command definition for clipboard group"
         LabelTitle="Clipboard"
         Keytip="CB" />
<Command Name="cmdCopy"
         Symbol="IDR_CMD_COPY"
         LabelTitle="Copy"
         LabelDescription="Copy"
         Keytip="C"
         TooltipTitle="Copy"
         TooltipDescription="Click to copy">
  <Command.SmallImages>
    <Image>res/copyS_16.bmp</Image>
  </Command.SmallImages>
  <Command.LargeImages>
    <Image>res/copyL_32.bmp</Image>
  </Command.LargeImages>
</Command>
<Command Name="cmdPaste"
         Symbol="IDR_CMD_PASTE" >
  <Command.LabelTitle>Paste</Command.LabelTitle>
  <Command.LabelDescription>
    <String Content="Paste contents of clipboard"
            Id="10001"
            Symbol="IDR_RES_LABELDESC_PASTE" />
  </Command.LabelDescription>
  <Command.Keytip>P</Command.Keytip>
  <Command.TooltipTitle>
    <String Content="Paste contents of clipboard"
            Id="10002"
            Symbol="IDR_RES_TOOLTIP_PASTE"/>
  </Command.TooltipTitle>
  <Command.TooltipDescription>
    <String Content="Click to paste contents of clipboard"/>
  </Command.TooltipDescription>
  <Command.SmallImages>
    <Image
      Id="10010"
      MinDPI="96"
      Symbol="IDR_RES_SMALL_IMAGE96">
      <Image.Source>res/pasteS_96bpp.bmp</Image.Source>
    </Image>
    <Image Source="res/pasteS_120bpp.bmp"
           Id="10011"
           MinDPI="120"
           Symbol="IDR_RES_SMALL_IMAGE120" />
  </Command.SmallImages>
  <Command.LargeImages>
    <Image>res/pasteL_32.bmp</Image>
  </Command.LargeImages>
</Command>
<Command Name="cmdMinimize"
         Symbol="IDR_CMD_MINIMIZE"
         Id="10001"
         LabelTitle="Minimize" />

Cette section de code présente les déclarations de contrôle Tab .

<Tab CommandName="cmdHomeTab">
  <Group CommandName="cmdClipboardGroup" 
         SizeDefinition="ThreeButtons">
    <Button CommandName="cmdCopy"/>
    <Button CommandName="cmdPaste"/>
    <ToggleButton CommandName="cmdMinimize"/>
  </Group>
</Tab>

Informations sur les éléments

  • Système minimum pris en charge : Windows 7
  • Peut être vide : Non

Voir aussi

Contrôle Tab

Contrôle Groupe d’onglets

SetModes