This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyPaintStyle.cs
45 lines (41 loc) · 1.63 KB
/
MyPaintStyle.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraBars.Styles;
using DevExpress.XtraBars.ViewInfo;
using System.Drawing;
using DevExpress.XtraBars.Docking;
using DevExpress.Skins;
using DevExpress.XtraBars.Docking.Paint;
using DevExpress.Utils.Drawing;
using System.Drawing.Drawing2D;
using DevExpress.XtraBars.Docking.Helpers;
namespace WindowsFormsApplication1
{
public class MyPaintStyle : SkinBarManagerPaintStyle
{
public MyPaintStyle (BarManagerPaintStyleCollection collection) : base(collection) { }
public override string Name { get { return "MyPaintStyle"; } }
protected override void CreatePainters()
{
base.CreatePainters();
this.fElementsPainter = new MySkinElementPainter(this);
}
}
public class MySkinElementPainter : DockElementsSkinPainter
{
public MySkinElementPainter(SkinBarManagerPaintStyle paintStyle) : base(paintStyle) { }
protected override void DrawActiveTab(DrawTabArgs tabArgs)
{
tabArgs.Appearance.BackColor = Color.Chocolate;
tabArgs.Appearance.BackColor2 = Color.Cornsilk;
tabArgs.Appearance.GradientMode = LinearGradientMode.Vertical;
tabArgs.DrawBackground();
DirectionRectangle rect = new DirectionRectangle(PaintHelper.CalcTabContentBounds(tabArgs, DockingSkins.SkinTabHeader), !tabArgs.IsVertical);
rect.CutFromHead(TabPanelPainter.TabHorzTextIndent);
rect.CutFromTail(1);
tabArgs.DrawString(tabArgs.TabLayout.TabText, rect.Bounds);
}
}
}