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

How to Dispose of a docked control?

Thread ID:





3208 Mar 7,2003 09:07 PM UTC Mar 9,2003 10:02 PM UTC WinForms 1
Tags: Tools
Thomas A. Anderson, Program Writer
Asked On March 7, 2003 09:07 PM UTC

The user of my WinForms app has the opportunity to create a floating window at runtime. This window will be associated with the DockingManager. When the user clicks the close button ('X') on this dockable window, I want the window to be disposed of permanently [there would be no valid reason for the user to ever want to see the window again]. My question is how/when do I dispose of it? My current approach is to respond to the DockVisibilityChanged event which is fired when the user clicks the 'X'. I then call "arg.Control.Dispose()". This SEEMS to work -- but is this the correct approach? I've disposed of the window, but I'm not sure if I've disposed of the SyncFusion wrapper that makes the window dockable. Do I need to somehow inform the DockingManager that I've disposed of the window?

Prakash S [Syncfusion]
Replied On March 9, 2003 10:02 PM UTC

Hi, If you intend to dispose off a dockable control, then it is necessary to call the DockingManager.SetEnableDocking(Control, bool) method on the particular control with a FALSE param before the dispose call. Instead of directly invoking SetEnableDocking from within the DockVisibilityChanged event handler, I would recommend that you keep track of all Controls that need to be disposed and then use some kind of an idle-time routine that examines and cleans up the hidden Controls periodically. Prakash Syncfusion


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

Live Chat Icon For mobile
Live Chat Icon