ComboBoxRenderer.IsSupported ComboBoxRenderer.IsSupported ComboBoxRenderer.IsSupported ComboBoxRenderer.IsSupported Property

정의

비주얼 스타일을 사용하여 콤보 상자를 그리는 데 ComboBoxRenderer 클래스를 사용할 수 있는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether the ComboBoxRenderer class can be used to draw a combo box with visual styles.

public:
 static property bool IsSupported { bool get(); };
public static bool IsSupported { get; }
member this.IsSupported : bool
Public Shared ReadOnly Property IsSupported As Boolean

속성 값

운영 체제에서 비주얼 스타일을 사용하고 있고 비주얼 스타일이 애플리케이션 창의 클라이언트 영역에 적용되면 true이고, 그렇지 않으면 false입니다.true if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, false.

예제

다음 코드 예제에서는 합니다 IsSupported 속성을 사용할지 여부를 확인 하는 ComboBoxRenderer 메서드.The following code example uses the IsSupported property to determine whether to use the ComboBoxRenderer methods. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ComboBoxRenderer 클래스입니다.This code example is part of a larger example provided for the ComboBoxRenderer class.

      // Draw the combo box in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override 
    {
        Control::OnPaint(e);

        if (!ComboBoxRenderer::IsSupported)
        {
            this->Parent->Text = "Visual Styles Disabled";
            return;
        }

        this->Parent->Text = "CustomComboBox Enabled";

        // Always draw the main text box and drop down arrow in their
        // current states
        ComboBoxRenderer::DrawTextBox(e->Graphics, topTextBoxRectangle,
            this->Text, this->Font, textBoxState);
        ComboBoxRenderer::DrawDropDownButton(e->Graphics, arrowRectangle,
            arrowState);

        // Only draw the bottom text box if the arrow has been clicked
        if (isActivated)
        {
            ComboBoxRenderer::DrawTextBox(e->Graphics,
                bottomTextBoxRectangle, bottomText, this->Font,
                textBoxState);
        }
    }
// Draw the combo box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    if (!ComboBoxRenderer.IsSupported)
    {
        this.Parent.Text = "Visual Styles Disabled";
        return;
    }

    this.Parent.Text = "CustomComboBox Enabled";

    // Always draw the main text box and drop down arrow in their 
    // current states
    ComboBoxRenderer.DrawTextBox(e.Graphics, topTextBoxRectangle,
        this.Text, this.Font, textBoxState);
    ComboBoxRenderer.DrawDropDownButton(e.Graphics, arrowRectangle,
        arrowState);

    // Only draw the bottom text box if the arrow has been clicked
    if (isActivated)
    {
        ComboBoxRenderer.DrawTextBox(e.Graphics,
            bottomTextBoxRectangle, bottomText, this.Font,
            textBoxState);
    }
}
' Draw the combo box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    MyBase.OnPaint(e)

    If Not ComboBoxRenderer.IsSupported Then
        Me.Parent.Text = "Visual Styles	Disabled"
        Return
    End If

    Me.Parent.Text = "CustomComboBox Enabled"

    ' Always draw the main text box and drop down arrow in their 
    ' current states.
    ComboBoxRenderer.DrawTextBox(e.Graphics, topTextBoxRectangle, _
        Me.Text, Me.Font, textBoxState)
    ComboBoxRenderer.DrawDropDownButton(e.Graphics, arrowRectangle, _
        arrowState)

    ' Only draw the bottom text box if the arrow has been clicked.
    If isActivated Then
        ComboBoxRenderer.DrawTextBox(e.Graphics, _
            bottomTextBoxRectangle, bottomText, Me.Font, textBoxState)
    End If
End Sub

설명

이 속성이 falseDrawTextBox 또는 DrawDropDownButton 메서드를 발생 시킵니다는 InvalidOperationException합니다.If this property is false, the DrawTextBox or DrawDropDownButton methods will throw an InvalidOperationException.

적용 대상

추가 정보