)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the tab strip color of auto hide tab in WinForms Docking Manager?

Platform: WinForms |
Control: DockingManager |
Published Date: April 30, 2011 |
Last Revised Date: December 6, 2019

Customization of tab strip color

This can be done by subclassing the docking manager and getting access to the internal AutoHide Tabs. Please refer the below code snippet which illustrates this.

C#

//left
foreach (AHTabPage Page in DockingManager1.AutoHiddenTabControlLeft.TabPages)
{
    //'''colore del font
    Page.TabForeColor = Color.Red;
    //'''backcolor del tab
    Page.TabBackColor = Color.SkyBlue;
    //'''backcolor del contenitore dei tab
    Page.Parent.BackColor = Color.DarkBlue;
}
//'''right.
foreach (AHTabPage Page in DockingManager1.AutoHiddenTabControlRight.TabPages)
{
    Page.TabForeColor = Color.DarkGoldenrod;
    Page.TabBackColor = Color.SkyBlue;
    Page.Parent.BackColor = Color.DarkBlue;
}
//'''top.
foreach (AHTabPage Page in DockingManager1.AutoHiddenTabControlTop.TabPages)
{
    Page.TabForeColor = Color.Yellow;
    Page.TabBackColor = Color.SkyBlue;
    Page.Parent.BackColor = Color.DarkBlue;
}
//'''bottom.
foreach (AHTabPage Page in DockingManager1.AutoHiddenTabControlBottom.TabPages)
{
    Page.TabForeColor = Color.Chocolate;
    Page.TabBackColor = Color.SkyBlue;
    Page.Parent.BackColor = Color.DarkBlue;
}
//'''tabbed.
if (DockingManager1.IsTabbed(arg.Controls[0]))
{
    DockHost dh = (DockHost)(arg.Controls[0].Parent);
    DockHostController dhc = (DockHostController)dh.InternalController;
    DockTabController dtc = (DockTabController)dhc.ParentController;
    dtc.TabControl.TabPanelBackColor = Color.FromArgb(213, 220, 226);
    //Accessing the Internal TabControl .Using this, You could set colors same as how you are setting colors for a TabControl.
    Syncfusion.Windows.Forms.Tools.DockTabControl docktab = (DockTabControl)dtc.TabControl;
docktab.ForeColor = Color.DarkBlue;
    //Setting the color for the selected Tab.
    docktab.ActiveTabColor = Color.SkyBlue;
    //Setting the Color for Inactive tab
    docktab.InactiveTabColor = Color.DarkBlue;
}

 

VB

''''left.
For Each Page As AHTabPage In DockingManager1.AutoHiddenTabControlLeft.TabPages
    ''''colore del font
    Page.TabForeColor = Color.Red
    ''''backcolor del tab
    Page.TabBackColor = Color.SkyBlue
    ''''backcolor del contenitore dei tab
    Page.Parent.BackColor = Color.DarkBlue
Next
''''right.
For Each Page As AHTabPage In DockingManager1.AutoHiddenTabControlRight.TabPages
    Page.TabForeColor = Color.DarkGoldenrod
    Page.TabBackColor = Color.SkyBlue
    Page.Parent.BackColor = Color.DarkBlue
Next
''''top.
For Each Page As AHTabPage In DockingManager1.AutoHiddenTabControlTop.TabPages
    Page.TabForeColor = Color.Yellow
    Page.TabBackColor = Color.SkyBlue
    Page.Parent.BackColor = Color.DarkBlue
Next
''''bottom.
For Each Page As AHTabPage In DockingManager1.AutoHiddenTabControlBottom.TabPages
    Page.TabForeColor = Color.Chocolate
    Page.TabBackColor = Color.SkyBlue
    Page.Parent.BackColor = Color.DarkBlue
Next
''''tabbed.
If DockingManager1.IsTabbed(arg.Controls(0)) Then
    Dim dh As DockHost = CType(arg.Controls(0).Parent, DockHost)
    Dim dhc As DockHostController = CType(dh.InternalController, DockHostController)
    Dim dtc As DockTabController = CType(dhc.ParentController, DockTabController)
    'dtc.TabControl.TabStyle = GetType(Syncfusion.Windows.Forms.Tools.OneNoteStyleRenderer)
    dtc.TabControl.TabPanelBackColor = Color.FromArgb(213, 220, 226)
    'Accessing the Internal TabControl .Using this, You could set colors same as how you are setting colors for a TabControl.
    Dim docktab As Syncfusion.Windows.Forms.Tools.DockTabControl = CType(dtc.TabControl, DockTabControl)
    docktab.ForeColor = Color.DarkBlue
    'Setting the color for the selected Tab.
    docktab.ActiveTabColor = Color.SkyBlue
    'Setting the Color for Inactive tab
    docktab.InactiveTabColor = Color.DarkBlue
End If

 

Sample: http://help.syncfusion.com/support/samples/kb/Tools.Windows/TDTabColor/TabColor.zip

Reference link: https://help.syncfusion.com/windowsforms/dockingmanager/appearance#customize-documenttdi-window

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon