Share via


RadioButtons.SelectedIndex Properti

Definisi

Mendapatkan atau mengatur indeks tombol radio yang dipilih.

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

Nilai Properti

Int32

int

Indeks tombol radio yang dipilih. Defaultnya adalah -1, yang menunjukkan bahwa tidak ada tombol radio yang dipilih.

Atribut
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Keterangan

Untuk informasi selengkapnya, panduan desain, dan contoh kode, lihat Tombol radio.

SelectedItem dan SelectedIndex disinkronkan. Mengubah salah satu properti akan mengakibatkan perubahan pada properti lainnya. Pengaturan SelectedIndex ke nilai apa pun di luar rentang koleksi Item menghasilkan SelectedItemnull.

Berlaku untuk

Lihat juga