# Creating a RadDock at Runtime

To create a **RadDock** in code, construct a **RadDock**, set properties and add to the controls collection of the form. The example below creates a **RadDock**, adds it to the form and docks a single **ToolWindow** to it. See [DockWindows](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods) for more information on instantiating **DockWindow** at runtime.

![WinForms RadDock Creating a RadDock at Runtime](https://www.telerik.com/products/winforms/documentation/assets/bd87a04b8e978932d839b7f3424d1d0c/dock-object-model-creating-a-raddock-at-runtime001.png)

## Creating a simple RadDock instance

```C#
RadDock radDock1 = new RadDock();
radDock1.Dock = DockStyle.Fill;
this.Controls.Add(radDock1);
ToolWindow toolWindow1 = new ToolWindow();
toolWindow1.Text = "A ToolWindow";
radDock1.DockWindow(toolWindow1, DockPosition.Left);
```

```VB.NET
Dim radDock1 As RadDock = New RadDock()
radDock1.Dock = DockStyle.Fill
Me.Controls.Add(radDock1)
Dim toolWindow1 As ToolWindow = New ToolWindow()
toolWindow1.Text = "A ToolWindow"
radDock1.DockWindow(toolWindow1, DockPosition.Left)
```

> caution You cannot set the DockPosition of the ToolWindow to Fill, unless you specify a target ToolWindow. If you try to set the DockPosition of a ToolWindow to Fill when there is no target ToolWindow, we throw an exception since a ToolWindow cannot fill RadDock entirely. This behavior is by design and it is the same as it is in Visual Studio. If you want to have a ToolWindow occupying RadDock entirely, you should dock it to a side (left/right/top/bottom) and set MainDocumentContainerVisible to false.

## See Also

* [AllowedDockStates](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/alloweddockstates)
* [Accessing DockWindows](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/accessing-dockwindows)
* [ 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)
* [Removing ToolWindow and DocumentWindow at Runtime](https://www.telerik.com/products/winforms/documentation/controls/dock/object-model/removing-toolwindow-and-documentwindow-at-runtime)
* [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)
