Поделиться через


VisualStyleElement.ComboBox.DropDownButton Класс

Определение

Предоставляет VisualStyleElement объекты для различных состояний раскрывающейся стрелки элемента управления со списком. Этот класс не может быть унаследован.

public: ref class VisualStyleElement::ComboBox::DropDownButton abstract sealed
public static class VisualStyleElement.ComboBox.DropDownButton
type VisualStyleElement.ComboBox.DropDownButton = class
Public Class VisualStyleElement.ComboBox.DropDownButton
Наследование
VisualStyleElement.ComboBox.DropDownButton

Примеры

В следующем примере кода показано, как создать объект VisualStyleRenderer с VisualStyleElement возвращаемым свойством Hot . Чтобы запустить этот пример, вставьте его в Форму Windows Form. Обработайте событие формы Paint и вызовите DrawVisualStyleElement_Button_DropDownButton2 метод из Paint метода обработки событий, передавая e как 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

Комментарии

Каждое свойство VisualStyleElement.ComboBox.DropDownButton класса возвращает VisualStyleElement для другого состояния раскрывающейся стрелки элемента управления со списком.

Свойства

Имя Описание
Disabled

Возвращает элемент визуального стиля, представляющий стрелку раскрывающегося списка в отключенном состоянии.

Hot

Возвращает элемент визуального стиля, представляющий стрелку раскрывающегося списка в горячем состоянии.

Normal

Возвращает элемент визуального стиля, представляющий стрелку раскрывающегося списка в обычном состоянии.

Pressed

Возвращает элемент визуального стиля, представляющий стрелку раскрывающегося списка в состоянии нажатия.

Применяется к

См. также раздел