RadioButton 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 RadioButton 類別的新執行個體。
public:
RadioButton();
public RadioButton ();
Public Sub New ()
範例
下列程式碼範例會建立並初始化 RadioButton ,提供切換按鈕的外觀、將其 AutoCheck 屬性設定為 false
,並將其新增至 Form 。
private void InitializeMyRadioButton()
{
// Create and initialize a new RadioButton.
RadioButton radioButton1 = new RadioButton();
// Make the radio button control appear as a toggle button.
radioButton1.Appearance = Appearance.Button;
// Turn off the update of the display on the click of the control.
radioButton1.AutoCheck = false;
// Add the radio button to the form.
Controls.Add(radioButton1);
}
Private Sub InitializeMyRadioButton()
' Create and initialize a new RadioButton.
Dim radioButton1 As New RadioButton()
' Make the radio button control appear as a toggle button.
radioButton1.Appearance = Appearance.Button
' Turn off the update of the display on the click of the control.
radioButton1.AutoCheck = False
' Add the radio button to the form.
Controls.Add(radioButton1)
End Sub
備註
的預設檢視 RadioButton 會將其文字對齊按鈕右邊,而 AutoCheck 屬性會設定為 true
。