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.

How to Dispose of a docked control?

Thread ID:

Created:

Updated:

Platform:

Replies:

3208 Mar 7,2003 04:07 PM Mar 9,2003 05:02 PM Windows Forms 1
loading
Tags: Tools
Thomas A. Anderson, Program Writer
Asked On March 7, 2003 04:07 PM

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 05:02 PM

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

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.

;