# Removing ToolWindow and DocumentWindow at Runtime

**RadDock** has two different methods which you can call if you want to remove a **ToolWindow**/**DocumentWindow**. The result from these methods depends on the **CloseAction** property which can have one of these values

* **Close:** When a **DockWindow** has its **CloseAction** set to *Close*, this window is closed and detached (but not disposed) from its **RadDock**. You cannot manage it from **RadDock** collections anymore.

* **Hide:** When a **DockWindow** has its **CloseAction** set to *Hide*, this window is only closed (hidden) in **RadDock**. However, this window is not detached from its **RadDock** and you can manage it from the **RadDock** collections.

* **CloseAndDispose:** When a **DockWindow** has its **CloseAction** set to **CloseAndDispose**, this window is closed and then disposed.

## **RemoveWindow**

This method closes and detaches (but does not dispose) a **DockWindow** regardless of its **CloseAction** property. This will happen if you pass only a **DockWindow** as a parameter. In addition, you can pass a **CloseAction** parameter. In this case, the **RemoveWindow** method will act differently in accordance with this parameter.

## CloseWindow

This method has a different result on a **DockWindow** instance, in accordance with the **CloseAction** property of this instance.

## Default behavior

**DocumentWindow**: If you do not set the **CloseAction** for a **DocumentWindow** and you close this **DocumentWindow** from the UI, this window is closed with **CloseAction** set to *CloseAndDispose*, i.e. the **DocumentWindow** is disposed and you cannot reuse it.

**ToolWindow**: If you do not set the **CloseAction** for a **ToolWindow** and you close the **ToolWindow** from the UI, this window is closed with **CloseAction** set to *Hide*, i.e. the **ToolWindow** is not disposed and you can reuse it later.

## See Also

* [AllowedDockStates](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/alloweddockstates)
* [Creating a RadDock at Runtime](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/creating-a-raddock-at-runtime)
* [ Creating ToolWindow and DocumentWindow at Runtime](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime)
* [Customizing Floating Windows](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/customizing-floating-windows)
* [Customizing TabStrip Items](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/customizing-tabstrip-items)
* [Building an Advanced Layout at Runtime](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/example-building-an-advanced-layout-at-runtime)
* [RadDock Properties and Methods](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/raddock-properties-and-methods)
* [Accessing DockWindows](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/accessing-dockwindows)
* [Tabs and Captions](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/tabs-and-captions)
* [ToolWindow and DocumentWindow Properties and Methods](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods)
* [Tracking the ActiveWindow](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/tracking-the-activewindow)
