All docs
V20.1
20.2 (EAP/Beta)
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TabbedView.CustomDrawTabHeader Event

Allows you to draw a tab header manually.

Namespace: DevExpress.XtraBars.Docking2010.Views.Tabbed

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

public event TabHeaderCustomDrawEventHandler CustomDrawTabHeader
Public Event CustomDrawTabHeader As TabHeaderCustomDrawEventHandler

Event Data

The CustomDrawTabHeader event's data class is TabHeaderCustomDrawEventArgs. The following properties provide information specific to this event:

Property Description
Bounds Gets the rectangle that specifies the bounds of the tab header.
Cache Provides access to the drawing surface and a cache of pens, fonts, and brushes.
ControlInfo Gets an object that contains information about the tab being drawn.
Graphics Provides access to the drawing surface.
Handled Gets or sets whether the event is handled and prevents the default draw operation from being performed.
Painter Provides access to the object that performs paint operations.
TabHeaderInfo Provides access to the object that contains information about the page being drawn.
TabHeaderRowInfo Provides access to the object that contains information about the row being drawn.

Examples

The code below shows how to draw a custom background in tab headers and header buttons.

using System.Drawing.Drawing2D;

HatchBrush myHatchBrush1 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.LightGray, Color.AliceBlue);
private void TabbedView_CustomDrawTabHeader(object sender, XtraTab.TabHeaderCustomDrawEventArgs e) {
    e.Cache.FillRectangle(myHatchBrush1, e.Bounds);
    e.DefaultDrawText();
    e.DefaultDrawImage();
    e.DefaultDrawButtons();
    e.Handled = true;
}
HatchBrush myHatchBrush2 = new HatchBrush(HatchStyle.DiagonalCross, Color.LightGray, Color.AliceBlue);
private void TabbedView_CustomDrawHeaderButton(object sender, XtraTab.HeaderButtonCustomDrawEventArgs e) {
    e.Cache.FillRectangle(myHatchBrush2, e.Bounds);
    e.DefaultDraw();
    e.Handled = true;
}
See Also