Share via


RadioButtons.SelectedIndex Propriedade

Definição

Obtém ou define o índice do botão de opção selecionado.

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 da propriedade

Int32

int

O índice do botão de opção selecionado. O padrão é -1, que indica que nenhum botão de opção está selecionado.

Atributos
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Comentários

Para obter mais informações, diretrizes de design e exemplos de código, consulte Botões de opção.

SelectedItem e SelectedIndex são sincronizados. A alteração de qualquer propriedade resultará em uma alteração para a outra. Definir SelectedIndex como qualquer valor fora do intervalo da coleção Items resulta em SelectedItem .null

Aplica-se a

Confira também