TabRenderer.DrawTabItem Metoda

Definicja

Rysuje kartę używaną do wybierania strony w kontrolce karty.

Przeciążenia

DrawTabItem(Graphics, Rectangle, TabItemState)

Rysuje kartę w określonym stanie i granicach.

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach oraz z opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, String, Font, TabItemState)

Rysuje kartę w określonym stanie i granicach oraz z określonym tekstem.

DrawTabItem(Graphics, Rectangle, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym obrazem oraz z opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, String, Font, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym tekstem oraz z opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, String, Font, TextFormatFlags, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym formatowaniem tekstu i tekstu oraz opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, String, Font, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym tekstem i obrazem oraz z opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach; z określonym tekstem, formatowaniem tekstu i obrazem; i z opcjonalnym prostokątem fokusu.

DrawTabItem(Graphics, Rectangle, TabItemState)

Rysuje kartę w określonym stanie i granicach.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach oraz z opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, String, Font, TabItemState)

Rysuje kartę w określonym stanie i granicach oraz z określonym tekstem.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ tabItemText, System::Drawing::Font ^ font, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string tabItemText, System.Drawing.Font font, System.Windows.Forms.VisualStyles.TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? tabItemText, System.Drawing.Font? font, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, tabItemText As String, font As Font, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

tabItemText
String

Element String do rysowania na karcie.

font
Font

Element Font do zastosowania do tabItemText.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym obrazem oraz z opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Drawing::Image ^ image, System::Drawing::Rectangle imageRectangle, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Drawing.Image image, System.Drawing.Rectangle imageRectangle, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, image As Image, imageRectangle As Rectangle, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

image
Image

Element Image do rysowania na karcie.

imageRectangle
Rectangle

Element Rectangle określający granice .image

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, String, Font, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym tekstem oraz z opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ tabItemText, System::Drawing::Font ^ font, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string tabItemText, System.Drawing.Font font, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? tabItemText, System.Drawing.Font? font, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, tabItemText As String, font As Font, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

tabItemText
String

Element String do rysowania na karcie.

font
Font

Element Font do zastosowania do tabItemText.

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Przykłady

Poniższy przykład kodu używa DrawTabItem(Graphics, Rectangle, String, Font, Boolean, TabItemState) metody w metodzie niestandardowej kontrolki OnPaint , aby narysować element tabulacji. Ten przykład kodu jest częścią większego przykładu podanego TabRenderer dla klasy.

    // 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

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, String, Font, TextFormatFlags, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym formatowaniem tekstu i tekstu oraz opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ tabItemText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string tabItemText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? tabItemText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, tabItemText As String, font As Font, flags As TextFormatFlags, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

tabItemText
String

Element String do rysowania na karcie.

font
Font

Element Font do zastosowania do tabItemText.

flags
TextFormatFlags

Bitowa kombinacja TextFormatFlags wartości.

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca truewartość .

Dotyczy

DrawTabItem(Graphics, Rectangle, String, Font, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach z określonym tekstem i obrazem oraz opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ tabItemText, System::Drawing::Font ^ font, System::Drawing::Image ^ image, System::Drawing::Rectangle imageRectangle, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string tabItemText, System.Drawing.Font font, System.Drawing.Image image, System.Drawing.Rectangle imageRectangle, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? tabItemText, System.Drawing.Font? font, System.Drawing.Image image, System.Drawing.Rectangle imageRectangle, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, tabItemText As String, font As Font, image As Image, imageRectangle As Rectangle, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Używany Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

tabItemText
String

Element String do rysowania na karcie.

font
Font

Element Font do zastosowania do tabItemText.

image
Image

Element Image do rysowania na karcie.

imageRectangle
Rectangle

Element Rectangle , który określa granice .image

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualne są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca wartość true.

Dotyczy

DrawTabItem(Graphics, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, TabItemState)

Rysuje kartę w określonym stanie i granicach; z określonym tekstem, formatowaniem tekstu i obrazem; i z opcjonalnym prostokątem fokusu.

public:
 static void DrawTabItem(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ tabItemText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Drawing::Image ^ image, System::Drawing::Rectangle imageRectangle, bool focused, System::Windows::Forms::VisualStyles::TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string tabItemText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageRectangle, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
public static void DrawTabItem (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? tabItemText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageRectangle, bool focused, System.Windows.Forms.VisualStyles.TabItemState state);
static member DrawTabItem : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.TabItemState -> unit
Public Shared Sub DrawTabItem (g As Graphics, bounds As Rectangle, tabItemText As String, font As Font, flags As TextFormatFlags, image As Image, imageRectangle As Rectangle, focused As Boolean, state As TabItemState)

Parametry

g
Graphics

Służy Graphics do rysowania karty.

bounds
Rectangle

Określa Rectangle granice karty.

tabItemText
String

Element String do rysowania na karcie.

font
Font

Element Font do zastosowania do tabItemText.

flags
TextFormatFlags

Bitowa kombinacja TextFormatFlags wartości.

image
Image

Element Image do rysowania na karcie.

imageRectangle
Rectangle

Element Rectangle , który określa granice .image

focused
Boolean

true aby narysować prostokąt fokusu; w przeciwnym razie , false.

state
TabItemState

TabItemState Jedna z wartości określających stan wizualny karty.

Wyjątki

System operacyjny nie obsługuje stylów wizualnych.

-lub-

Style wizualizacji są wyłączone przez użytkownika w systemie operacyjnym.

-lub-

Style wizualne nie są stosowane do obszaru klienta okien aplikacji.

Uwagi

Przed wywołaniem tej metody należy sprawdzić, czy IsSupported właściwość zwraca wartość true.

Dotyczy