menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DrawTabEventArgs - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DrawTabEventArgs

    Provides data for the DrawItem event of TabControlAdv.

    Inheritance
    System.Object
    System.EventArgs
    DrawTabEventArgs
    Inherited Members
    System.EventArgs.Empty
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Forms.Tools
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class DrawTabEventArgs : EventArgs
    Remarks

    This class contains all the information needed for the user to paint the specified item. It provides the BackColor, ForeColor, Bounds (includes space for the border), BoundsInterior(does not include space for the borders), etc. It also provides access to the default drawing logic of the tabs using its DrawXXX methods.

    In case you use the default drawing logic for drawing the borders, then you can use the BoundsInterior to get the rectangular area without the borders to draw your custom interior.

    Constructors

    DrawTabEventArgs(DrawTabEventArgs)

    Constructor of the DrawTabEventArgs.

    Declaration
    public DrawTabEventArgs(DrawTabEventArgs args)
    Parameters
    Type Name Description
    DrawTabEventArgs args

    DrawTabEventArgs(Graphics, Font, Rectangle, Int32, DrawItemState, Color, Color, Rectangle, DrawTabEventArgs.DrawDefaultBackground, DrawTabEventArgs.DrawDefaultBorders, DrawTabEventArgs.DrawDefaultInterior)

    Creates a new instance of the DrawTabEventArgs.

    Declaration
    public DrawTabEventArgs(Graphics g, Font font, Rectangle bounds, int index, DrawItemState state, Color foreColor, Color backColor, Rectangle boundsInterior, DrawTabEventArgs.DrawDefaultBackground defaultDrawBackground, DrawTabEventArgs.DrawDefaultBorders defaultDrawBorders, DrawTabEventArgs.DrawDefaultInterior defaultDrawInterior)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The Graphics object into which to draw.

    System.Drawing.Font font

    The font using which to draw the tab.

    System.Drawing.Rectangle bounds

    The exterior bounds of the tab.

    System.Int32 index

    The index of this tab in the TabControlAdv.

    System.Windows.Forms.DrawItemState state

    The state of this item.

    System.Drawing.Color foreColor

    The color of the text.

    System.Drawing.Color backColor

    The background color.

    System.Drawing.Rectangle boundsInterior

    The interior bounds of this tab.

    DrawTabEventArgs.DrawDefaultBackground defaultDrawBackground

    A reference to the method that performs default background drawing.

    DrawTabEventArgs.DrawDefaultBorders defaultDrawBorders

    A reference to the method that performs default border drawing.

    DrawTabEventArgs.DrawDefaultInterior defaultDrawInterior

    A reference to the method that performs default image and text drawing.

    Properties

    BackColor

    Gets / sets the background color.

    Declaration
    public Color BackColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    A Color value.

    Bounds

    Returns the rectangle that represents the bounds of the item that is being drawn.

    Declaration
    public Rectangle Bounds { get; set; }
    Property Value
    Type
    System.Drawing.Rectangle

    BoundsInterior

    Returns the interior of the tab minus the borders.

    Declaration
    public Rectangle BoundsInterior { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    A Rectangle specifying the interior area.

    Font

    Gets / sets the font assigned to the tab being drawn.

    Declaration
    public Font Font { get; set; }
    Property Value
    Type
    System.Drawing.Font

    ForeColor

    Gets / sets the color of the text.

    Declaration
    public Color ForeColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    A Color value.

    Graphics

    Returns the graphics surface to draw the item on.

    Declaration
    public Graphics Graphics { get; }
    Property Value
    Type
    System.Drawing.Graphics

    Index

    Returns the index value of the item that is being drawn.

    Declaration
    public int Index { get; }
    Property Value
    Type
    System.Int32

    State

    Gets / sets the state of the item being drawn.

    Declaration
    public DrawItemState State { get; set; }
    Property Value
    Type
    System.Windows.Forms.DrawItemState

    TextBrush

    Gets / sets the text brush, with which to draw the text in the tabs.

    Declaration
    public Brush TextBrush { get; set; }
    Property Value
    Type Description
    System.Drawing.Brush

    A System.Drawing.Brush instance with which to draw the text.

    Remarks

    This value will be null when the DrawItem event gets fired. If you then specify a brush before calling the DrawInterior() method, that brush will be used to draw the text.

    Methods

    DrawBackground()

    Overridden. See System.Windows.Forms.DrawItemEventArgs.DrawBackground.

    Declaration
    public virtual void DrawBackground()

    DrawBorders()

    Draws the borders within the bounds specified in the DrawTabEventArgs constructor and with the appropriate color.

    Declaration
    public void DrawBorders()
    Remarks

    Notes to Inheritors: When overriding DrawBorders in a derived class, be sure to call the base class's DrawBorders method.

    DrawInterior()

    Draws the text and image within the bounds specified in the DrawTabEventArgs constructor and with the appropriate color.

    Declaration
    public void DrawInterior()
    Remarks

    Notes to Inheritors: When overriding DrawInterior in a derived class, be sure to call the base class's DrawInterior method.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved