VisualStyleElement.Button.CheckBox Klasa

Definicja

Udostępnia VisualStyleElement obiekty dla różnych stanów kontrolki pola wyboru. Klasa ta nie może być dziedziczona.

public: ref class VisualStyleElement::Button::CheckBox abstract sealed
public static class VisualStyleElement.Button.CheckBox
type VisualStyleElement.Button.CheckBox = class
Public Class VisualStyleElement.Button.CheckBox
Dziedziczenie
VisualStyleElement.Button.CheckBox

Przykłady

W poniższym przykładzie kodu pokazano, jak utworzyć obiekt VisualStyleRenderer z właściwością zwróconą VisualStyleElementVisualStyleElement.Button.CheckBox przez właściwość . Aby uruchomić ten przykład, wklej go do formularza systemu Windows. Obsłuż zdarzenie formularza Paint i wywołaj metodę DrawVisualStyleElement_Button_CheckBox1 z Paint metody obsługi zdarzeń, przekazując e jako PaintEventArgs.

public void DrawVisualStyleElement_Button_CheckBox1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Button.CheckBox.UncheckedNormal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.UncheckedNormal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Button.CheckBox.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_CheckBox1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Button.CheckBox.UncheckedNormal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Button.CheckBox.UncheckedNormal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Button.CheckBox.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

Uwagi

Każda właściwość VisualStyleElement.Button.CheckBox klasy zwraca VisualStyleElement wartość dla innego stanu kontrolki pola wyboru.

Właściwości

CheckedDisabled

Pobiera element stylu wizualizacji, który reprezentuje wyłączone pole wyboru w stanie zaznaczonym.

CheckedHot

Pobiera element stylu wizualizacji, który reprezentuje gorące pole wyboru w stanie zaznaczonego.

CheckedNormal

Pobiera element stylu wizualizacji, który reprezentuje normalne pole wyboru w stanie zaznaczonym.

CheckedPressed

Pobiera element stylu wizualizacji, który reprezentuje naciśnięte pole wyboru w stanie zaznaczonym.

MixedDisabled

Pobiera element stylu wizualizacji, który reprezentuje wyłączone pole wyboru w stanie nieokreślonym.

MixedHot

Pobiera element stylu wizualizacji, który reprezentuje gorące pole wyboru w stanie nieokreślonym.

MixedNormal

Pobiera element stylu wizualizacji, który reprezentuje normalne pole wyboru w stanie nieokreślonym.

MixedPressed

Pobiera element stylu wizualizacji, który reprezentuje naciśnięte pole wyboru w stanie nieokreślonym.

UncheckedDisabled

Pobiera element stylu wizualizacji, który reprezentuje wyłączone pole wyboru w stanie niezaznaczone.

UncheckedHot

Pobiera element stylu wizualizacji, który reprezentuje gorące pole wyboru w stanie niezaznaczonego.

UncheckedNormal

Pobiera element stylu wizualizacji, który reprezentuje normalne pole wyboru w stanie niezaznaczonego.

UncheckedPressed

Pobiera element stylu wizualizacji, który reprezentuje naciśnięte pole wyboru w stanie niezaznaczone.

Dotyczy

Zobacz też