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

SetEnableDocking unwanted behavior

Thread ID:





91896 Dec 8,2009 08:13 PM UTC Dec 10,2009 10:09 AM UTC WinForms 5
Tags: Tools
Jonathan Richard
Asked On December 8, 2009 08:13 PM UTC


I need to create a floating window that can be dockable. I use this code:

mDockingManager.SetEnableDocking(myForm, true);
mDockingManager.FloatControl(form, new Rectangle(location.X, location.Y, width, height));

It seems that the method SetEnableDocking dock my form at left and display it before changing it to a floating window (I can see flicker of the docking operation). I wonder if it possible to directly display my floating window without being firstly docked implicitly by the dock manager.

I was able to reduce the flicker by using these methods:

//my code ...

but maybe there is a much "cleaner" way to do it.
Thank you


Githanjali S [Syncfusion]
Replied On December 9, 2009 06:42 AM UTC

Hi Jonathan,

For a floating window to be directly displayed without being docked to the docking manager at first,the following code is sufficient:

dockingManager1.FloatControl(panel1, new Rectangle(30,30,300,300));

You can later dock the control by double clicking on the caption or right click on the caption.

Currently LockHostFormUpdate and UnlockHostFormUpdate are the available methods to prevent flickering.


Jonathan Richard
Replied On December 9, 2009 02:22 PM UTC


the call of mDockingManager.FloatControl (without calling m.DockManager.SetEnableDocking before) seems to work with a simple control (e.g. a textbox) but when I try with a form an exception is raised. It says "cannot add a first level control into a control". Thank you


Jonathan Richard
Replied On December 9, 2009 04:09 PM UTC


It seems that this is the mDockingManager.LockDockPanelsUpdate() and not the mDockingManager.LockHostForm() that avoid flicker when opening a floating window. However it may cause unwanted behavior if the operation between the lock and unlock calls is too long (e.g. windows that are behind the application are drawn over the application during an instant!). This is a really bad side effect so I think there should be cleaner way to open a dockable form as floating window without having to twick the draw. Do you think that you could correct this behavior soon? For example the SetEnableDocking method may support a visibility parameters. Thank you


Jonathan Richard
Replied On December 9, 2009 07:43 PM UTC


Ok the call:

dockingManager1.FloatControl(ctrl, new Rectangle(30,30,300,300));

work on UserControl. I'm studying the possibility of creating my windows with UserControl instead of WinForms. In that way it may be more compatible with your docking manager. Don't you think? thank you


Githanjali S [Syncfusion]
Replied On December 10, 2009 10:09 AM UTC

Hi Jonathan,

You could use the following steps to make a floating form to be directly displayed without being docked to the docking manager at first,

Form2 frm = new Form2();
frm.FormBorderStyle = FormBorderStyle.None;
frm.TopLevel = false;
this.dockingManager1.FloatControl(frm, new Rectangle(30, 30, 300, 300));



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