RadioButtons.SelectedIndex Proprietà

Definizione

Ottiene o imposta l'indice del pulsante di opzione selezionato.

public:
 property int SelectedIndex { int get(); void set(int value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
int SelectedIndex();

void SelectedIndex(int value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
int SelectedIndex();

void SelectedIndex(int value);
public int SelectedIndex { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")]
public int SelectedIndex { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="-1")] set; }
var int32 = radioButtons.selectedIndex;
radioButtons.selectedIndex = int32;
Public Property SelectedIndex As Integer

Valore della proprietà

Int32

int

Indice del pulsante di opzione selezionato. Il valore predefinito è -1, che indica che non è selezionato alcun pulsante di opzione.

Attributi
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Commenti

Per altre info, indicazioni sulla progettazione ed esempi di codice, vedi Pulsanti di opzione.

SelectedItem e SelectedIndex vengono sincronizzati. La modifica di una proprietà comporterà una modifica all'altra. Se si imposta SelectedIndex su qualsiasi valore esterno all'intervallo dell'insieme Items , viene restituito SelectedItemnull.

Si applica a

Vedi anche