)
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 set the color and font style to the active tab in the docked tab window in WinForms Docking Manager?

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

Color and Font style to active tab

If the docking windows are grouped together as the DockTab control, then it will internally initiate the DockTabController as the Parent controller of the DockHostcontrol. By this DockTabController we can access the Tabbed group docking windows.

The above procedures are implemented as the following code:

C#

private void dockingManager1_DockStateChanged(object sender, System.EventArgs e)
{
    Syncfusion.Windows.Forms.Tools.DockHost dhost = this.panel1.Parent as  Syncfusion.Windows.Forms.Tools.DockHost; //panel1 is a docked control and currently in tabbed style
    Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController;
    if(dhc.ParentController is Syncfusion.Windows.Forms.Tools.DockTabController)
    {
       //Accessing the Internal Tab
       Syncfusion.Windows.Forms.Tools.DockTabControl docktab = (dhc.ParentController as Syncfusion.Windows.Forms.Tools.DockTabController).TabControl;
       //Setting the Font style and color for the selected Tab.
       docktab.ActiveTabFont = new System.Drawing.Font("TimesNewRoman",10,FontStyle.Bold);
       docktab.ActiveTabColor= System.Drawing.Color.FromArgb(196,214,233);
       //Setting the Font Style for Inactive tab
       docktab.InactiveTabColor= System.Drawing.Color.FromArgb(102,110,152);
       docktab.Font= new System.Drawing.Font("Arial",10);
    }
}

 

VB

Private Sub dockingManager1_DockStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dockingManager1.NewDockStateEndLoad
    Dim dhost As Syncfusion.Windows.Forms.Tools.DockHost = CType(IIf(TypeOf Me.panel1.Parent Is Syncfusion.Windows.Forms.Tools.DockHost, Me.panel1.Parent, Nothing),  Syncfusion.Windows.Forms.Tools.DockHost) 'panel1 is a docked control and currently in tabbed style
    Dim dhc As Syncfusion.Windows.Forms.Tools.DockHostController = CType(IIf(TypeOf dhost.InternalController Is Syncfusion.Windows.Forms.Tools.DockHostController, dhost.InternalController, Nothing), Syncfusion.Windows.Forms.Tools.DockHostController)
    If TypeOf dhc.ParentController Is Syncfusion.Windows.Forms.Tools.DockTabController Then
       'Accessing the Internal Tab
       Dim docktab As Syncfusion.Windows.Forms.Tools.DockTabControl = CType(IIf(TypeOf  dhc.ParentController Is Syncfusion.Windows.Forms.Tools.DockTabController, dhc.ParentController,  Nothing), Syncfusion.Windows.Forms.Tools.DockTabController).TabControl
       'Setting the Font style and color for the selected Tab.
       docktab.ActiveTabFont = New System.Drawing.Font("TimesNewRoman",10,FontStyle.Bold)
       docktab.ActiveTabColor= System.Drawing.Color.FromArgb(196,214,233)
       'Setting the Font Style for Inactive tab
       docktab.InactiveTabColor= System.Drawing.Color.FromArgb(102,110,152)
       docktab.Font= New System.Drawing.Font("Arial",10)
    End If
End Sub

 

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