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

Tabbing Automatically by Appending

Hello,

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 ?



3 Replies

AD Administrator Syncfusion Team 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.

[C#]

IEnumerator ienum = this.dockingManager1.Controls;
ArrayList dockedctrls = new ArrayList();
while (ienum.MoveNext())
dockedctrls.Add(ienum.Current);
// 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.

http://files.syncfusion.com/support/Tools.Windows/7.1.0.30/F80444/Tools_WF_TabbedDocking.zip

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.

Regards,
Jaya




AD Administrator Syncfusion Team 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 ?



AD Administrator Syncfusion Team 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.


[C#]

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

Please let me know if this helps you.

Regards,
Jaya


Loader.
Live Chat Icon For mobile
Up arrow icon