Documentation for DockContainer

DockContainer.AddToolWindow Method 

Add a tool window to be managed by this dock container. The caller must show the form to make it visible.

public void AddToolWindow(
   DockableToolWindow toolWindow
);

Parameters

toolWindow
tool window to be added

Remarks

This method assume that tool window is not null. A NullReferenceException will be thrown if the tool window is null.

The window is not docked when is added with this method. To add the form with initial dock, use the DockToolWindow method.

The following properties are forced to restricted values:


DockContainer is not the owner of the added toolWindow so is not responsable with disposing it.


When a toolWindow (which was added to this container) is disposed or when its parent is changed, that toolWindow is automatically removed from this container.

Example

Here is a sample of how to use this method. It will add a floating form to the dock container.

private void ShowNewForm ()
{
   // Create a new instance of the child form.
   DockableToolWindow childForm = new DockableToolWindow ();

   // Add the form to the dock container
   _dockContainer1.AddToolWindow (childForm);

   // Show the form
   childForm.Show ();
}

See Also

DockContainer Class | Crom.Controls Namespace