Share via


VisualStyleElement.Button.RadioButton Kelas

Definisi

Menyediakan VisualStyleElement objek untuk berbagai status kontrol tombol radio. Kelas ini tidak dapat diwariskan.

public: ref class VisualStyleElement::Button::RadioButton abstract sealed
public static class VisualStyleElement.Button.RadioButton
type VisualStyleElement.Button.RadioButton = class
Public Class VisualStyleElement.Button.RadioButton
Warisan
VisualStyleElement.Button.RadioButton

Contoh

Contoh kode berikut menunjukkan cara membuat VisualStyleRenderer dengan yang VisualStyleElement dikembalikan oleh VisualStyleElement.Button.RadioButton properti . Untuk menjalankan contoh ini, tempelkan ke dalam Formulir Windows. Tangani peristiwa formulir Paint dan panggil DrawVisualStyleElement_Button_RadioButton1 metode dari Paint metode penanganan peristiwa, meneruskan e sebagai PaintEventArgs.

public void DrawVisualStyleElement_Button_RadioButton1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Button.RadioButton.UncheckedNormal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Button.RadioButton.UncheckedNormal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Button.RadioButton.UncheckedNormal",
             this.Font, Brushes.Black, new Point(10, 10));
    }
    else
        e.Graphics.DrawString("This element is not defined in the current visual style.",
             this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElement_Button_RadioButton1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Button.RadioButton.UncheckedNormal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Button.RadioButton.UncheckedNormal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Button.RadioButton.UncheckedNormal", _
          Me.Font, Brushes.Black, New Point(10, 10))
    Else
        e.Graphics.DrawString("This element is not defined in the current visual style.", _
          Me.Font, Brushes.Black, New Point(10, 10))
    End If
End Sub

Keterangan

Setiap properti VisualStyleElement.Button.RadioButton kelas mengembalikan VisualStyleElement untuk status kontrol tombol radio yang berbeda.

Properti

CheckedDisabled

Mendapatkan elemen gaya visual yang mewakili tombol radio yang dinonaktifkan dalam status dicentang.

CheckedHot

Mendapatkan elemen gaya visual yang mewakili tombol radio panas dalam status dicentang.

CheckedNormal

Mendapatkan elemen gaya visual yang mewakili tombol radio normal dalam status dicentang.

CheckedPressed

Mendapatkan elemen gaya visual yang mewakili tombol radio yang ditekan dalam status dicentang.

UncheckedDisabled

Mendapatkan elemen gaya visual yang mewakili tombol radio yang dinonaktifkan dalam status tidak dicentang.

UncheckedHot

Mendapatkan elemen gaya visual yang mewakili tombol radio panas dalam status tidak dicentang.

UncheckedNormal

Mendapatkan elemen gaya visual yang mewakili tombol radio normal dalam status tidak dicentang.

UncheckedPressed

Mendapatkan elemen gaya visual yang mewakili tombol radio yang ditekan dalam status tidak dicentang.

Berlaku untuk

Lihat juga