[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TControl.Dock

Move the control into a new docksite.

## Declaration

Source position: controls.pp line 1252

`public procedure TControl.Dock(`
`NewDockSite: TWinControl;`
`ARect: TRect`
`); virtual;`

## Arguments

`NewDockSite` |  | The host control to which which the current control is to be docked
`ARect` |  | The position at which the control is to be docked

## Description

Removes the control from the DockClients of the old docksite, and adds it to the DockClients of the new docksite. Adjusts the position and extent for the new docksite, then calls the DoAdd/RemoveDockClient methods of the old and new docksite.

Performs checks that there is already a valid host control to which the present control is to be docked, removes old controls from the list of docked controls and adds the new control to the list, then calls DoDock to position the control.

## Errors

An exception is raised if there is already a docking process in progress for this control

The latest version of this document can be found at lazarus-ccr.sourceforge.net.