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

Tabbing Automatically by Appending

Thread ID:





80444 Apr 3,2009 01:20 AM UTC Apr 6,2009 12:28 PM UTC WinForms 3
Tags: Tools
Administrator [Syncfusion]
Asked On April 3, 2009 01:20 AM UTC


I have a menuon the main form, and when I click on different buttons, it opens a corresponding panel. I have a docking manager for the main form.

I would like to dock the first panel that opens as filled on the main form. And then every other new panel thats opened should be tabbed next to the existing panel on main form. Currently my panel opens as a float control. Then I manually dock panels on top of each other, which creates the tabs next to each other.

How do I achieve this ?

Administrator [Syncfusion]
Replied On April 3, 2009 07:32 AM UTC

Hi Murali,

Thank you for using Syncfusion products.

If you want to tab new panel with the control present in the form , you can achieve this by iterating through the control collection of dockingManager to look for any docked control present in the form and tab with the new panel.

Please use the code snippet below.


IEnumerator ienum = this.dockingManager1.Controls;
ArrayList dockedctrls = new ArrayList();
while (ienum.MoveNext())
// Enable docking for new panel
this.dockingManager1.SetEnableDocking(this.panel3, true);
// Iterating through the collection to perform the required operation.
foreach (Control ctrl in dockedctrls)
this.dockingManager1.DockControl(ctrl, this.panel3, DockingStyle.Tabbed, 100);

Here is the sample that demonstrates this.


The above code snippet can also be used to tab the floatcontrol present in the form with the new panel.

Please let me know if this helps you.


Administrator [Syncfusion]
Replied On April 3, 2009 02:29 PM UTC

Thanks for the code sample.

But I expect users to click the menu as many times and they can have many panels opened. With the code that you have given, you are looping through the docking manager controls and painting them as tabbed every time. I may be wrong about this, but your code causing flickering on the main form and then gets tabbed. The opening of a panel and then it getting tabbed is kinda visible to the user.

And as there are many panels, the flickering gets worse. I see the panels in the flickering before they get tabbed together.

Any help here ?

Administrator [Syncfusion]
Replied On April 6, 2009 12:28 PM UTC

Hi Murali,

Thanks for the update.

The methods LockHostFormUpdate and UnLockHostFormUpdate are used to lock and unlock the host form's updates respectively. These methods helps in avoiding flickering.

These methods can be used in the following way.


this.dockingManager1.SetEnableDocking(this.panel2, true);
docking code

Please let me know if this helps you.



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

or the page will be automatically redirected to 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