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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing dock tabs programatically

Thread ID:





287 May 22,2002 08:34 AM UTC May 1,2003 07:59 PM UTC WinForms 3
Tags: Tools
Paul Mason
Asked On May 22, 2002 08:34 AM UTC

Hi If you have a couple of controls docked together so that the form a tab group docked to the side of a form (using a docking manager)- is it possible to programatically change tabs? i.e - I want to bring a docked control "to the front" if it is covered by other docked controls. Thanks

Prakash S [Syncfusion]
Replied On May 22, 2002 02:32 PM UTC

Paul, The Docking Windows implementation does not have a direct way for programmatically changing the selection in a tabbed docking group. However, you can do this by directly accessing the internal docking windows classes and changing the selected tab. The following code shows the approach,
// To activate the docking window tab representing the treeView1 control
	Syncfusion.Windows.Forms.Tools.DockHost dhost = this.treeView1.Parent as Syncfusion.Windows.Forms.Tools.DockHost;
	Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController;
	// Verify that the control is docked as a tab group
	if((dhc.ParentController != null) && (dhc.ParentController is Syncfusion.Windows.Forms.Tools.DockTabController))
{				Syncfusion.Windows.Forms.Tools.DockTabController dtc = dhc.ParentController as Syncfusion.Windows.Forms.Tools.DockTabController;
	Syncfusion.Windows.Forms.Tools.DockTabControl tabcontrol = dtc.TabControl as Syncfusion.Windows.Forms.Tools.DockTabControl;
	Syncfusion.Windows.Forms.Tools.DockTabPage activetab = tabcontrol.SelectedTab as Syncfusion.Windows.Forms.Tools.DockTabPage;
	// Verify that the control is not the selected tab
	if(activetab.dhcClient != dhc)
	    // Iterate tabpages and activate the treeview tab
	    foreach(Syncfusion.Windows.Forms.Tools.DockTabPage page in tabcontrol.TabPages)
		if(page.dhcClient == dhc)
		    tabcontrol.SelectedTab = page;
Prakash Syncfusion, Inc.

David Whatley
Replied On May 1, 2003 04:39 PM UTC

Is this still the only way to do this? -- David

Prakash S [Syncfusion]
Replied On May 1, 2003 07:59 PM UTC

Hi David, Starting with v of Essential Tools, the DockingManager has an ActivateControl(Control) method that can be used for this purpose. For more details please refer to the Class Reference documentation on this method. Prakash Syncfusion


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

Live Chat Icon For mobile
Live Chat Icon