VisualStyleElement.ComboBox.DropDownButton Třída

Definice

Poskytuje VisualStyleElement objekty pro různé stavy rozevírací šipky ovládacího prvku pole se seznamem. Tato třída se nemůže dědit.

public: ref class VisualStyleElement::ComboBox::DropDownButton abstract sealed
public static class VisualStyleElement.ComboBox.DropDownButton
type VisualStyleElement.ComboBox.DropDownButton = class
Public Class VisualStyleElement.ComboBox.DropDownButton
Dědičnost
VisualStyleElement.ComboBox.DropDownButton

Příklady

Následující příklad kódu ukazuje, jak vytvořit VisualStyleRenderer s VisualStyleElement vrácenou Hot vlastností . Pokud chcete spustit tento příklad, vložte ho do formuláře Windows Form. Zpracujte Paint událost formuláře a zavolejte metodu DrawVisualStyleElement_Button_DropDownButton2Paint z metody zpracování událostí a předejte e ji 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

Poznámky

Každá vlastnost VisualStyleElement.ComboBox.DropDownButton třídy vrátí VisualStyleElement pro jiný stav rozevírací šipky ovládacího prvku pole se seznamem.

Vlastnosti

Disabled

Získá prvek vizuálního stylu, který představuje šipku rozevíracího seznamu v zakázaném stavu.

Hot

Získá vizuální styl prvek, který představuje šipku rozevíracího seznamu v horkém stavu.

Normal

Získá prvek vizuálního stylu, který představuje šipku rozevíracího seznamu v normálním stavu.

Pressed

Získá prvek vizuálního stylu, který představuje šipku rozevíracího seznamu ve stisknutém stavu.

Platí pro

Viz také