-
Notifications
You must be signed in to change notification settings - Fork 4
/
MdiTabStripColorTable.cs
82 lines (55 loc) · 1.75 KB
/
MdiTabStripColorTable.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
namespace Menees.Windows.Forms
{
#region Using Directives
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
#endregion
internal sealed class MdiTabStripColorTable : ProfessionalColorTable
{
#region Private Data Members
private readonly MdiTabStrip tabStrip;
#endregion
#region Constructors
internal MdiTabStripColorTable(MdiTabStrip tabStrip)
{
this.tabStrip = tabStrip;
}
#endregion
#region Public Properties
public override Color ButtonCheckedGradientBegin => SelectedTab;
public override Color ButtonCheckedGradientEnd => this.ButtonCheckedGradientBegin;
public override Color ButtonPressedGradientBegin => Pressed;
public override Color ButtonPressedGradientEnd => this.ButtonPressedGradientBegin;
public override Color ButtonSelectedBorder => SelectedTabBorder;
public override Color ToolStripGradientBegin
{
get
{
// If the tab strip has a custom back color, then use it.
// Otherwise, use our own default back color.
Color result = this.tabStrip.BackColor;
if (result == Control.DefaultBackColor)
{
result = BackColor;
}
return result;
}
}
public override Color ToolStripGradientEnd => this.ToolStripGradientBegin;
public override Color ToolStripGradientMiddle => this.ToolStripGradientBegin;
#endregion
#region Internal Properties
internal static Color SelectedTab => SystemColors.ButtonHighlight;
internal static Color SelectedTabBorder => SystemColors.Highlight;
#endregion
#region Private Properties
private static Color Pressed => SelectedTab;
private static Color BackColor => SystemColors.InactiveCaption;
#endregion
}
}