TabRenderer.DrawTabPage(Graphics, Rectangle) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 범위에서 탭 페이지를 그립니다.
public:
static void DrawTabPage(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds);
public static void DrawTabPage(System.Drawing.Graphics g, System.Drawing.Rectangle bounds);
static member DrawTabPage : System.Drawing.Graphics * System.Drawing.Rectangle -> unit
Public Shared Sub DrawTabPage (g As Graphics, bounds As Rectangle)
매개 변수
예외
운영 체제는 비주얼 스타일을 지원하지 않습니다.
-또는-
운영 체제의 사용자가 비주얼 스타일을 사용하지 않도록 설정합니다.
-또는-
시각적 스타일은 애플리케이션 창의 클라이언트 영역에 적용되지 않습니다.
예제
다음 코드 예제에서는 사용자 지정 컨트롤의 OnPaint 메서드에서 탭 페이지를 그리는 메서드를 사용 DrawTabPage 합니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 TabRenderer 일부입니다.
// Draw the tab page and the tab items.
protected:
virtual void OnPaint(PaintEventArgs^ e) override
{
__super::OnPaint(e);
if (!TabRenderer::IsSupported)
{
this->Parent->Text = "CustomTabControl Disabled";
return;
}
TabRenderer::DrawTabPage(e->Graphics, tabPageRectangle);
TabRenderer::DrawTabItem(e->Graphics, tabItemRectangle1,
tab1Text, this->Font, tab1Focused, tab1State);
TabRenderer::DrawTabItem(e->Graphics, tabItemRectangle2,
tab2Text, this->Font, tab2Focused, tab2State);
this->Parent->Text = "CustomTabControl Enabled";
}
// Draw the tab page and the tab items.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!TabRenderer.IsSupported)
{
this.Parent.Text = "CustomTabControl Disabled";
return;
}
TabRenderer.DrawTabPage(e.Graphics, tabPageRectangle);
TabRenderer.DrawTabItem(e.Graphics, tabItemRectangle1,
tab1Text, this.Font, tab1Focused, tab1State);
TabRenderer.DrawTabItem(e.Graphics, tabItemRectangle2,
tab2Text, this.Font, tab2Focused, tab2State);
this.Parent.Text = "CustomTabControl Enabled";
}
' Draw the tab page and the tab items.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
If Not TabRenderer.IsSupported Then
Me.Parent.Text = "CustomTabControl Disabled"
Return
End If
TabRenderer.DrawTabPage(e.Graphics, tabPageRectangle)
TabRenderer.DrawTabItem(e.Graphics, tabItemRectangle1, _
tab1Text, Me.Font, tab1Focused, tab1State)
TabRenderer.DrawTabItem(e.Graphics, tabItemRectangle2, _
tab2Text, Me.Font, tab2Focused, tab2State)
Me.Parent.Text = "CustomTabControl Enabled"
End Sub
설명
이 메서드를 호출하기 전에 속성이 IsSupported 반환 true되는지 확인해야 합니다.