/
MySkinTabPainter.cs
49 lines (43 loc) · 1.75 KB
/
MySkinTabPainter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraTab.Registrator;
using DevExpress.XtraTab.Drawing;
using DevExpress.XtraTab;
using DevExpress.Utils;
using DevExpress.XtraTab.ViewInfo;
namespace WindowsApplication1
{
public class MySkinTabPainter : SkinTabPainter
{
public MySkinTabPainter(DevExpress.XtraTab.IXtraTab tabControl)
: base(tabControl)
{
}
protected override void DrawHeader(TabDrawArgs e)
{
base.DrawHeader(e);
Rectangle bounds = e.Bounds;
string headerText = "----------------------- Custom draw header -----------------------";
e.Graphics.DrawString(headerText, new Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.Black, bounds);
bounds.Offset(-2, -2);
e.Graphics.DrawString(headerText, new Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.White, bounds);
foreach (BaseTabRowViewInfo rowInfo in e.ViewInfo.HeaderInfo.Rows)
{
for (int i = 0; i < rowInfo.Pages.Count; i++)
{
Rectangle pageBounds = rowInfo.Pages[i].Bounds;
pageBounds.Offset(0, 20);
e.Graphics.DrawString(Environment.NewLine + "Custom draw", AppearanceObject.DefaultFont, Brushes.Black, pageBounds);
pageBounds.Offset(-1, -1);
e.Graphics.DrawString(Environment.NewLine + "Custom draw", AppearanceObject.DefaultFont, Brushes.Yellow, pageBounds);
}
}
}
}
}