VisualStyleElement.ComboBox.DropDownButton Klasse

Definition

Stellt VisualStyleElement-Objekte für die unterschiedlichen Zustände des Dropdownpfeils des Kombinationsfeld-Steuerelements bereit. Diese Klasse kann nicht vererbt werden.

public: ref class VisualStyleElement::ComboBox::DropDownButton abstract sealed
public static class VisualStyleElement.ComboBox.DropDownButton
type VisualStyleElement.ComboBox.DropDownButton = class
Public Class VisualStyleElement.ComboBox.DropDownButton
Vererbung
VisualStyleElement.ComboBox.DropDownButton

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie sie mit dem VisualStyleElement von der Hot -Eigenschaft zurückgegebenen erstellenVisualStyleRenderer. Um dieses Beispiel auszuführen, fügen Sie es in ein Windows Form-Formular ein. Behandeln Sie das Ereignis des Formulars Paint , und rufen Sie die DrawVisualStyleElement_Button_DropDownButton2 -Methode aus der Paint Ereignisbehandlungsmethode auf, und übergeben Sie e als PaintEventArgs.

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

Hinweise

Jede Eigenschaft der VisualStyleElement.ComboBox.DropDownButton -Klasse gibt einen VisualStyleElement für einen anderen Zustand des Dropdownpfeils des Kombinationsfeld-Steuerelements zurück.

Eigenschaften

Disabled

Ruft ein visuelles Stilelement ab, das einen Dropdownpfeil im nicht aktiven Zustand darstellt.

Hot

Ruft ein visuelles Stilelement ab, das einen Dropdownpfeil im aktiven Zustand darstellt.

Normal

Ruft ein visuelles Stilelement ab, das einen Dropdownpfeil im normalen Zustand darstellt.

Pressed

Ruft ein visuelles Stilelement ab, das einen Dropdownpfeil im gedrückten Zustand darstellt.

Gilt für:

Weitere Informationen