TabRenderer.DrawTabItem Método

Definição

Desenha um tabulador que é usado para selecionar uma página no controlo de separador.

Sobrecargas

Name Description
DrawTabItem(Graphics, Rectangle, TabItemState)

Desenha uma tabulação no estado e limites especificados.

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Desenha uma tabulação no estado e limites especificados, e com um retângulo de foco opcional.

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

Desenha uma tabulação no estado e limites especificados, e com o texto especificado.

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

Desenha uma tabulação no estado e limites especificados, com a imagem especificada e com um retângulo de foco opcional.

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

Desenha uma tabulação no estado e limites especificados, com o texto especificado e com um retângulo de foco opcional.

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

Desenha uma tabulação no estado e limites especificados, com o texto e a formatação de texto especificados, e com um retângulo de foco opcional.

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

Desenha uma tabulação no estado e limites especificados, com o texto e a imagem especificados, e com um retângulo de foco opcional.

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

Desenha uma tabulação no estado e limites especificados; com o texto especificado, a formatação do texto e a imagem; e com um retângulo de foco opcional.

DrawTabItem(Graphics, Rectangle, TabItemState)

Desenha uma tabulação no estado e limites especificados.

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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

DrawTabItem(Graphics, Rectangle, Boolean, TabItemState)

Desenha uma tabulação no estado e limites especificados, e com um retângulo de foco opcional.

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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados, e com o texto especificado.

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);
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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

tabItemText
String

O String para desenhar no separador.

font
Font

O Font para aplicar a tabItemText.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados, com a imagem especificada e com um retângulo de foco opcional.

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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

image
Image

O Image para desenhar no separador.

imageRectangle
Rectangle

O Rectangle que especifica os limites de image.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados, com o texto especificado e com um retângulo de foco opcional.

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);
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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

tabItemText
String

O String para desenhar no separador.

font
Font

O Font para aplicar a tabItemText.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Exemplos

O seguinte exemplo de código utiliza o DrawTabItem(Graphics, Rectangle, String, Font, Boolean, TabItemState) método de um controlo OnPaint personalizado para desenhar um item de tabulação. Este exemplo de código faz parte de um exemplo maior fornecido para a TabRenderer classe.

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

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados, com o texto e a formatação de texto especificados, e com um retângulo de foco opcional.

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);
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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

tabItemText
String

O String para desenhar no separador.

font
Font

O Font para aplicar a tabItemText.

flags
TextFormatFlags

Uma combinação bit a bit dos TextFormatFlags valores.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados, com o texto e a imagem especificados, e com um retângulo de foco opcional.

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);
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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

tabItemText
String

O String para desenhar no separador.

font
Font

O Font para aplicar a tabItemText.

image
Image

O Image para desenhar no separador.

imageRectangle
Rectangle

O Rectangle que especifica os limites de image.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a

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

Desenha uma tabulação no estado e limites especificados; com o texto especificado, a formatação do texto e a imagem; e com um retângulo de foco opcional.

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);
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)

Parâmetros

g
Graphics

Eles Graphics costumavam desenhar a tab.

bounds
Rectangle

O Rectangle que especifica os limites da tabulação.

tabItemText
String

O String para desenhar no separador.

font
Font

O Font para aplicar a tabItemText.

flags
TextFormatFlags

Uma combinação bit a bit dos TextFormatFlags valores.

image
Image

O Image para desenhar no separador.

imageRectangle
Rectangle

O Rectangle que especifica os limites de image.

focused
Boolean

true desenhar um retângulo de foco; caso contrário, false.

state
TabItemState

Um dos TabItemState valores que especifica o estado visual do separador.

Exceções

O sistema operativo não suporta estilos visuais.

-ou-

Os estilos visuais são desativados pelo utilizador no sistema operativo.

-ou-

Estilos visuais não são aplicados à área cliente das janelas de aplicação.

Observações

Antes de usar este método, deve verificar se a IsSupported propriedade retorna true.

Aplica-se a