TabRenderer.DrawTabPage(Graphics, Rectangle) 메서드

정의

지정된 범위를 사용하여 탭 페이지를 그립니다.

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)

매개 변수

g
Graphics

탭 페이지를 그릴 때 사용되는 Graphics입니다.

bounds
Rectangle

탭 페이지의 범위를 지정하는 Rectangle입니다.

예외

운영 체제에서 비주얼 스타일을 지원하지 않는 경우

또는

운영 체제에서 사용자가 비주얼 스타일을 사용하지 않도록 설정한 경우

또는

비주얼 스타일이 애플리케이션 창의 클라이언트 영역에 적용되지 않은 경우

예제

다음 코드 예제에서는 합니다 DrawTabPage 메서드는 사용자 지정 컨트롤의 OnPaint 탭 페이지를 그리는 방법입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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합니다.

적용 대상