RadioButtons.SelectedIndex Properti

Definisi

Mendapatkan atau mengatur indeks tombol radio yang dipilih.

Dokumentasi ini berlaku untuk WinUI 2 untuk UWP (untuk WinUI di SDK Aplikasi Windows, lihat namespace SDK Aplikasi Windows).

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; }
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 ke properti lainnya. Pengaturan SelectedIndex ke nilai apa pun di luar rentang koleksi Item mengakibatkan SelectedItem .null

Berlaku untuk

Lihat juga