How to change tab and headers colors
Default colors are handled by the UserInterfaceManager
class. You can set your own set of custom colors using the CustomColorTable
property on the active UserInterfaceManager
. Then it is simply a matter of setting the RenderStyle
property to RenderStyle.Custom
.
Code Example:
ColorTable myColors = new ColorTable(); UserInterfaceManager.FillBlueColorTable(myColors); // Docking Heading Colors // "I" stands for Inactive, "Start" and "End" of gradient myColors[SkinColors.DockHeadIStart] = Color.Aqua; myColors[SkinColors.DockHeadIEnd] = Color.Aquamarine; // TabbedDocument tab Colors // "H" stands for Hovered, "I" for Inactive and "A" for Active myColors[SkinColors.DocumentTabHI] = Color.Aquamarine; myColors[SkinColors.DocumentTabHA] = Color.Aquamarine; UserInterfaceManager.Active.CustomColorTable = myColors; UserInterfaceManager.Active.RenderStyle = RenderStyle.Custom;
The code above will create a new color table and use it as the custom color table, then force rendering to use the custom color table just created by setting the RenderStyle
property to RenderStyle.Custom
.
Note that changing colors can also be achieved by writing a custom renderer inherited from the DockRender
class. This is a much more powerful way of customizing the GUI as it allows an application to completely overwrite and customize all the drawing within the framework. For more information see the Rendering Engine Tutorial.