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.
Unfortunately, activation email could not send to your email. Please try again.

Tabbing Automatically by Appending

Thread ID:

Created:

Updated:

Platform:

Replies:

80444 Apr 2,2009 09:20 PM Apr 6,2009 08:28 AM Windows Forms 3
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 2, 2009 09:20 PM

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 ?



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


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



Administrator [Syncfusion]
Replied On April 3, 2009 10:29 AM

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 08:28 AM

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


CONFIRMATION

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.

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.

;