Sdílet prostřednictvím


TabRenderer.DrawTabItem Metoda

Definice

Nakreslí kartu, která slouží k výběru stránky v ovládacím prvku karta.

Přetížení

Name Description
DrawTabItem(Graphics, Rectangle, TabItemState)

Nakreslí tabulátor v zadaném stavu a mezích.

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Nakreslí tabulátor v zadaném stavu a hranicích a s volitelným obdélníkem fokusu.

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

Nakreslí tabulátor v zadaném stavu a hranicích a se zadaným textem.

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

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným obrázkem a s volitelným obdélníkem fokusu.

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

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a s volitelným obdélníkem fokusu.

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

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a formátováním textu a s volitelným obdélníkem fokusu.

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

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a obrázkem a s volitelným obdélníkem fokusu.

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

Nakreslí tabulátor v zadaném stavu a hranicích; se zadaným textem, formátováním textu a obrázkem; a s volitelným obdélníkem fokusu.

DrawTabItem(Graphics, Rectangle, TabItemState)

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a mezích.

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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích a se zadaným textem.

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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

tabItemText
String

Na String kartě se má kreslit.

font
Font

To Font platí pro tabItemText.

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným obrázkem a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

image
Image

Na Image kartě se má kreslit.

imageRectangle
Rectangle

Určuje Rectangle hranice image.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

tabItemText
String

Na String kartě se má kreslit.

font
Font

To Font platí pro tabItemText.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Příklady

Následující příklad kódu používá metodu DrawTabItem(Graphics, Rectangle, String, Font, Boolean, TabItemState) v metodě vlastního ovládacího prvku OnPaint k nakreslení položky karty. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu 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

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a formátováním textu a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

tabItemText
String

Na String kartě se má kreslit.

font
Font

To Font platí pro tabItemText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích se zadaným textem a obrázkem a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

tabItemText
String

Na String kartě se má kreslit.

font
Font

To Font platí pro tabItemText.

image
Image

Na Image kartě se má kreslit.

imageRectangle
Rectangle

Určuje Rectangle hranice image.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro

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

Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs
Zdroj:
TabRenderer.cs

Nakreslí tabulátor v zadaném stavu a hranicích; se zadaným textem, formátováním textu a obrázkem; a s volitelným obdélníkem 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

Slouží Graphics k kreslení tabulátoru.

bounds
Rectangle

Určuje Rectangle hranice tabulátoru.

tabItemText
String

Na String kartě se má kreslit.

font
Font

To Font platí pro tabItemText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

image
Image

Na Image kartě se má kreslit.

imageRectangle
Rectangle

Určuje Rectangle hranice image.

focused
Boolean

truenakreslit obdélník fokusu; v opačném případě . false

state
TabItemState

Jedna z TabItemState hodnot, která určuje vizuální stav karty.

Výjimky

Operační systém nepodporuje vizuální styly.

nebo

Vizuální styly jsou zakázány uživatelem v operačním systému.

nebo

Styly vizuálů se nepoužívají v klientské oblasti oken aplikací.

Poznámky

Před voláním této metody byste měli ověřit, zda IsSupported vlastnost vrací true.

Platí pro