Elemento Button

Rappresenta un controllo Button .

Utilizzo

<Button
  ApplicationModes = "xs:string"
  CommandName = "xs:positiveInteger or xs:string"
  ApplicationDefaults.IsChecked = "Boolean"/>

Attributi

Attributo Type Obbligatoria Descrizione
ApplicationDefaults.IsChecked
Boolean
No
Questo attributo è valido solo quando l'elemento Button è figlio di QuickAccessToolbar.ApplicationDefaults.
Limitato a uno dei valori seguenti:

(true)
Valore predefinito.
(false)
ApplicationModes
xs:string
No
Valido solo se MenuGroup è l'elemento padre.

(xs:string)
Stringa che contiene un elenco delimitato da virgole di interi compresi tra 0 e 31.
Lo spazio vuoto è valido e ignorato.
Lunghezza massima: 250 caratteri.
CommandName
xs:positiveInteger o xs:string
No
Associa l'elemento a un comando.

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

Elementi figlio

Non ci sono elementi figlio.

Elementi padre

Elemento
ControlGroup
DropDownButton
DropDownGallery
Gruppo
Menugroup
QuickAccessToolbar.ApplicationDefaults
SplitButton
SplitButton.ButtonItem
SplitButtonGallery

Commenti

Facoltativa.

Può verificarsi al massimo una volta per ogni elemento SplitButton.ButtonItem .

Può verificarsi una o più volte per ogni elemento ControlGroup, DropDownButton, DropDownGallery, Group, MenuGroup, QuickAccessToolbar.ApplicationDefaults, SplitButton o SplitButtonGallery.

Button supporta le modalità applicazione quando è ospitata nella colonna sinistra del menu applicazione.

Esempio

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

Questa sezione di codice mostra le dichiarazioni Button Command, con un gruppo associato che funge da contenitore padre per l'elemento Button .

<!-- Button -->
<Command Name="cmdButtonGroup"
         Symbol="cmdButtonGroup"
         Comment="Button Group"
         LabelTitle="ButtonGroup"/>
<Command Name="cmdButton1"
         Symbol="cmdButton1"
         Comment="Button1"
         LabelTitle="Button1"/>
<Command Name="cmdButton2"
         Symbol="cmdButton2"
         Comment="Button2"
         LabelTitle="Button2"/>
<Command Name="cmdButton3"
         Symbol="cmdButton3"
         Comment="Button3"
         LabelTitle="Button3"/>
<Command Name="cmdButtonGroup2"
         Symbol="cmdButtonGroup2"
         Comment="Button Group2"
         LabelTitle="ButtonGroup2"/>
<Command Name="cmdButtonG21"
         Symbol="cmdButtonG21"
         Comment="ButtonG21"
         LabelTitle="ButtonG21">
  <Command.LargeImages>
    <Image Source="res/large.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/small.bmp"/>
  </Command.SmallImages>
</Command>
<Command Name="cmdButtonG22"
         Symbol="cmdButtonG22"
         Comment="ButtonG22"
         LabelTitle="ButtonG22">
  <Command.LargeImages>
    <Image Source="res/large.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/small.bmp"/>
  </Command.SmallImages>
</Command>
<Command Name="cmdButtonG23"
         Symbol="cmdButtonG23"
         Comment="ButtonG23"
         LabelTitle="ButtonG23">
  <Command.LargeImages>
    <Image Source="res/large.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/small.bmp"/>
  </Command.SmallImages>
</Command>
<Command Name="cmdButtonG24"
         Symbol="cmdButtonG24"
         Comment="ButtonG24"
         LabelTitle="ButtonG24">
  <Command.LargeImages>
    <Image Source="res/large.bmp"/>
  </Command.LargeImages>
  <Command.SmallImages>
    <Image Source="res/small.bmp"/>
  </Command.SmallImages>
</Command>

Questa sezione di codice mostra le dichiarazioni di controllo Button .

<Group CommandName="cmdButtonGroup"
       SizeDefinition="ThreeButtons">
  <Button CommandName="cmdButton1"></Button>
  <Button CommandName="cmdButton2"></Button>
  <Button CommandName="cmdButton3"></Button>
</Group>

Informazioni sull'elemento

  • Sistema minimo supportato: Windows 7
  • Può essere vuoto: Sì

Vedi anche

Controllo pulsante

SetModes