Dispose on ToolWindow Close

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Alfred Chan
Avatar
Is there a property of DockManager that calls dispose on the contents of a ToolWindow when it is closed?

Comments (3)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Alfred,

No since a tool window's lifetime is not until you close it and remove it from the bar manager (it can still be available but not "active" in the layout). This is different from a document window's lifetime, which is intended to generally only be while it is displayed. We do have a property that controls whether document windows are disposed automatically but not tool windows, and that is because of the lifetime designs.

What you probably could do is handle WindowClosed and in that, remove the tool window from the DockManager and dispose it if you no longer need it.


Actipro Software Support

Posted 18 years ago by Alfred Chan
Avatar
I prefer the flexible placement of ToolWindows vs. DocumentWindows. How do you manually remove a toolwindow from the DockManager?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
dockManager.ToolWindows.Remove does that but actually now that I look at the code, calling ToolWindow.Dispose also removes it from the DockManager before it gets disposed.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.