共用方式為


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

範例

以下程式碼範例示範如何用屬性VisualStyleElement回傳Hot的 來建立 aVisualStyleRenderer。 要執行這個範例,請將它貼到 Windows 表單中。 處理表單的Paint事件,並從DrawVisualStyleElement_Button_DropDownButton2事件處理方法呼叫該Paint方法,傳遞ePaintEventArgs

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 每個屬性會回傳 a VisualStyleElement ,代表組合框控制項下拉箭頭的不同狀態。

屬性

名稱 Description
Disabled

會有一個視覺樣式元素,代表在停用狀態下下拉箭頭。

Hot

會有一個視覺風格元素,代表熱狀態下的下拉箭頭。

Normal

獲得一個視覺樣式元素,代表正常狀態下的拉選弓箭頭。

Pressed

會獲得一個視覺樣式元素,代表按下狀態下的拉弓箭頭。

適用於

另請參閱