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 informazioni, indicazioni sulla progettazione e esempi di codice, vedere Pulsanti di opzione.

SelectedItem e SelectedIndex vengono sincronizzati. La modifica di una proprietà comporta una modifica all'altra. L'impostazione SelectedIndex su qualsiasi valore all'esterno dell'intervallo dell'insieme Items comporta l'esecuzione SelectedItemnulldi .

Si applica a

Vedi anche