VisualStyleElement.ComboBox.DropDownButton Klasa

Definicja

Udostępnia VisualStyleElement obiekty dla różnych stanów strzałki listy rozwijanej kontrolki pola kombi. Klasa ta nie może być dziedziczona.

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

Przykłady

W poniższym przykładzie kodu pokazano, jak utworzyć obiekt VisualStyleRenderer z właściwością zwróconą VisualStyleElement Hot przez właściwość . Aby uruchomić ten przykład, wklej go w formularzu Windows. Obsłuż zdarzenie formularza Paint i wywołaj metodę DrawVisualStyleElement_Button_DropDownButton2 z Paint metody obsługi zdarzeń, przekazując e jako 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

Uwagi

Każda właściwość VisualStyleElement.ComboBox.DropDownButton klasy zwraca VisualStyleElement wartość dla innego stanu strzałki listy rozwijanej kontrolki pola kombi.

Właściwości

Disabled

Pobiera element stylu wizualizacji, który reprezentuje strzałkę listy rozwijanej w stanie wyłączonym.

Hot

Pobiera element stylu wizualizacji reprezentujący strzałkę listy rozwijanej w stanie gorąca.

Normal

Pobiera element stylu wizualizacji, który reprezentuje strzałkę listy rozwijanej w normalnym stanie.

Pressed

Pobiera element stylu wizualizacji reprezentujący strzałkę listy rozwijanej w stanie naciśniętym.

Dotyczy

Zobacz też