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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there any way to customize the Tab Strip color of AutoHideTab Control?

 

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

Article ID: Published Date: Last Revised Date: Platform: Control:
1267 04/30/2011 07/10/2014 WinForms DockingManager
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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