Skip to main content

Dock Sites

  • 3 minutes to read

Dock sites hold dock controls on forms. If there are no dock sites on a form, dock control can only float. Also, dock sites provide the auto hiding functionality for dock controls. When a control is docked to a dock site (or any layout site residing on it) the auto hide feature can be enabled for it.

Creating Dock Sites


To create a dock site, you need to place a TdxDockSite control onto a form. The image below shows how this can be achieved.

Once a dock site is created, you can place dock controls onto it.

Generally, you will need a single dock site on a form. If the dock site occupies the entire client area of a form, dock controls can be docked to any form edge as specified by the site’s AllowDockClients property. However, only dock controls can reside on dock sites. Thus, if you have a dock site that fills the entire form, you will need to place a dock panel onto it that will serve as the container for controls that must reside on the form. Please refer to the Quick Start section for details on building a basic docking application.

To move a dock site at design time, use a specially designed selector. Dragging this selector allows you to move a dock site even if its area is fully occupied by child dock controls. You can also click this selector to access the dock site’s properties via the Object Inspector.

Docking Controls to Dock Sites


To dock a control to a dock site, it must be dragged by its caption to the dock site’s area. Basically, dock controls can be docked to any edge of the dock site and to its entire client area. The image below shows how to dock a floating panel to the left edge of the dock site that fills the entire form. (The design-time example is shown.)

As you can see in the above image, the dock panel displays its own caption when docked. Also, the auto hide button is visible.

Consider the Object TreeView window that corresponds to the application state after the panel has been docked to the dock site.

As you can see, a layout site has been created. This layout site fills the dock site’s area not occupied by the docked panel. Other controls can be either docked to the dock site, the panel or the generated layout site. Refer to the Layout Sites topic for more information on the purpose of layout sites.

Note that dock sites can have only two direct child controls – the docked control and the neighboring layout site. These child controls can have their own children, etc.

Feature Specifics


Since dock sites merely serve as containers for other dock controls, they do not support many of the features provided by dock panels. They cannot be docked or resized, cannot display caption buttons and the auto hide feature cannot be enabled for them.

See Also