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

How to change the TabStyle of the DockingManager?

Platform: WinForms |
Control: DockingManager |
Published Date: April 30, 2011 |
Last Revised Date: July 10, 2014

 

There is no straight method or property to achieve this. but this can be achieved by getting the DockTabControl object from DockHostController and apply the TabStyle for the DockTabControl. Please refer the below code snippet which illustrates this:

C#

private void button1_Click(object sender, EventArgs e)

{

Syncfusion.Windows.Forms.Tools.DockHost dhost = this.panel1.Parent as Syncfusion.Windows.Forms.Tools.DockHost;

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 DockTabControl from the DockHostController

Syncfusion.Windows.Forms.Tools.DockTabControl docktab = (dhc.ParentController as

Syncfusion.Windows.Forms.Tools.DockTabController).TabControl;

//Applying the TabStyle to the DockTabControl

docktab.TabStyle = typeof(Syncfusion.Windows.Forms.Tools.OneNoteStyleRenderer);

}

}

VB

Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click

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)

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 DockTabControl from the DockHostController

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

'Applying the TabStyle to the DockTabControl

docktab.TabStyle = GetType(Syncfusion.Windows.Forms.Tools.OneNoteStyleRenderer)

End If

End Sub

Sample:

http://help.syncfusion.com/support/samples/KB/Tools.Windows/TDTabStyle/TabStyle.zip

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.

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