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

TControl.ReplaceDockedControl

Remove a previously docked control and put a new control in its place

Declaration

Source position: controls.pp line 1259

public function TControl.ReplaceDockedControl(

  Control: TControl;

  NewDockSite: TWinControl;

  DropControl: TControl;

  ControlSide: TAlign

):Boolean;

Arguments

Control

  

The old control that was previously docked at this site

NewDockSite

  

The new site for docking; used if DropControl is nil

DropControl

  

The control site to be used for docking, unless it is nil when it is igored. Passed straight through as an argument to ManualDock

ControlSide

  

The side to which the new control is to be aligned; passed straight through as an argument to ManualDock

Function result

Returns True if a docked control has been successfully replaced with a new one

Description

This method works only when the control to replace resides in a managed docksite (using an DockManager), or is not docked at all. Even then exist situations where it won't work as expected, depending on the used DockManager and other subtle conditions.

When the control to replace is docked, then it's replaced by this control; otherwise this control becomes floating (seems to be a design flaw).

Finally the control to replace is docked into NewDockSite, according to DropControl and ControlSide (see TControl.ManualDock).

This method primarily exists for use by the DockManager itself, for NoteBook docking. It should not be used in application code.

See also

#lcl.Controls.TControl.ManualDock

  

Docks a control programmatically.

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