RadioButtons.SelectedIndex 屬性

定義

取得或設定所選單選按鈕的索引。

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

屬性值

Int32

int

所選單選按鈕的索引。 默認值為 -1,表示未選取任何單選按鈕。

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

備註

如需詳細資訊、設計指引和程式碼範例,請參閱 單選按鈕

SelectedItemSelectedIndex 已同步處理。 變更任一屬性會導致另一個屬性變更。 將 設定SelectedIndexItems 集合範圍以外的任何值,會導致 SelectedItemnull

適用於

另請參閱