Bagikan melalui


RadioButton.Appearance Properti

Definisi

Mendapatkan atau menetapkan nilai yang menentukan tampilan RadioButton.

public:
 property System::Windows::Forms::Appearance Appearance { System::Windows::Forms::Appearance get(); void set(System::Windows::Forms::Appearance value); };
public System.Windows.Forms.Appearance Appearance { get; set; }
member this.Appearance : System.Windows.Forms.Appearance with get, set
Public Property Appearance As Appearance

Nilai Properti

Salah Appearance satu nilai. Nilai defaultnya adalah Normal.

Pengecualian

Nilai yang ditetapkan bukan salah Appearance satu nilai.

Contoh

Contoh kode berikut membuat dan menginisialisasi RadioButton, memberinya tampilan kontrol pengalih, mengatur propertinya AutoCheck ke false, dan menambahkannya ke 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

Keterangan

Appearance Jika nilai diatur ke Normal, maka kontrol digambar RadioButton dengan kotak centang melingkar. Jika nilai diatur ke Button, maka RadioButton digambar sebagai kontrol yang dapat diubah ke status atas atau bawah. Salah satu jenis dapat menampilkan teks, gambar, atau keduanya.

Berlaku untuk

Lihat juga