Lenguaje

RadioButtons.SelectedIndex Propiedad

Definición

Obtiene o establece el índice del botón de radio seleccionado.

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

Valor de propiedad

Int32

int

Índice del botón de radio seleccionado. El valor predeterminado es -1, que indica que no hay ningún botón de radio seleccionado.

Atributos
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Comentarios

Para obtener más información, instrucciones de diseño y ejemplos de código, consulta Botones de radio.

SelectedItem y SelectedIndex están sincronizados. Al cambiar cualquiera de las propiedades, se producirá un cambio en el otro. Si se establece SelectedIndex en cualquier valor fuera del intervalo de la colección Items , el SelectedItem resultado es null.

Se aplica a

Consulte también