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

dispose of a control

Thread ID:





91967 Dec 10,2009 03:07 PM UTC Dec 11,2009 02:51 PM UTC WinForms 2
Tags: Tools
Jonathan Richard
Asked On December 10, 2009 03:07 PM UTC


When I close a window I would like to dispose its embedded control. I use this code:

mDockingManager.SetEnableDocking(myCtrl, false);

When I call the method SetEnableDocking I see a annoying ficker of my control that appears during an instant before being disposed.

In older post I saw that you recommend to use the method LockHostFormUpdate() to avoid flicker but this as no effect when the window is floating.

Do you have other suggestions to avoid flickers? I also tried the LockDockPanelsUpdate but it come with others problems (application behing my application is draw over mine). thanks

Jonathan Richard
Replied On December 10, 2009 04:01 PM UTC

I found a custom trick to avoid the flicker for now. I set the size of my control to 0 before calling the SetEnableDocking(myCtrl,false). It seems to be working...does someone have a better idea? Thank you


Rajasekar B [Syncfusion]
Replied On December 11, 2009 02:51 PM UTC

Hi Jonathan,

Flicker occurs when you disable the docking for any control because once the setEnableDocking(ctrl, false) is called the docking window is removed from the control. But the control still remains in the same position till you dispose it.

You can also set the region of the control to 0 before calling SetEnableDocking. Below is the sample code:

this.ctrl.Region=new Region(new Rectangle(0,0,0,0));
this.dockingManager1.SetEnableDocking(this.ctrl, false);

Let me kow if you have any question.



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