TextBoxRenderer.IsSupported 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
비주얼 스타일을 사용하여 텍스트 상자를 그리는 데 TextBoxRenderer 클래스를 사용할 수 있는지 여부를 나타내는 값을 가져옵니다.
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입니다.
예제
다음 코드 예제에서는 합니다 IsSupported 속성을 사용할지 여부를 확인 하는 DrawTextBox 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 TextBoxRenderer 클래스입니다.
// Use DrawText with the current TextFormatFlags.
protected:
virtual void OnPaint(PaintEventArgs^ e) override
{
__super::OnPaint(e);
if (TextBoxRenderer::IsSupported)
{
TextBoxRenderer::DrawTextBox(e->Graphics, textBorder, this->Text,
this->Font, textRectangle, textFlags, TextBoxState::Normal);
this->Parent->Text = "CustomTextBox Enabled";
}
else
{
this->Parent->Text = "CustomTextBox Disabled";
}
}
// Use DrawText with the current TextFormatFlags.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (TextBoxRenderer.IsSupported)
{
TextBoxRenderer.DrawTextBox(e.Graphics, textBorder, this.Text,
this.Font, textRectangle, textFlags, TextBoxState.Normal);
this.Parent.Text = "CustomTextBox Enabled";
}
else
{
this.Parent.Text = "CustomTextBox Disabled";
}
}
' Use DrawText with the current TextFormatFlags.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
If TextBoxRenderer.IsSupported Then
TextBoxRenderer.DrawTextBox(e.Graphics, textBorder, Me.Text, _
Me.Font, textRectangle, textFlags, TextBoxState.Normal)
Me.Parent.Text = "CustomTextBox Enabled"
Else
Me.Parent.Text = "CustomTextBox Disabled"
End If
End Sub
설명
이 속성이 false서 DrawTextBox 메서드는 throw는 InvalidOperationException.