Skip to main content

Dock Panels

  • 3 minutes to read

Dock panels are the main building blocks of any docking application – they represent the client area of dock windows and serve as containers for any VCL control so that they act as forms in this regard.

Creating Dock Panels


To add a dock panel to your application, place a TdxDockPanel control onto a form.

Note that the dock panel is not placed directly onto the form. An underlying float form is automatically created for it. However, dock panels cannot reside on forms. Thus, a float site is created on the float form to accommodate the panel. This can be seen in the Object TreeView window.

Note

the form where a dock panel has been created is assigned to the ParentForm property of the panel. Dock controls that have different values for the ParentForm property cannot be docked to one another. Thus, if you have a dock site on another form, the dock panel cannot be docked to it.

If you already have a dock site on your form, you can place a new dock panel directly to the site. The dock panel will reside on the dock site as a result. The image below shows an example.

As can be seen in the Object TreeView window, the dock panel’s parent is the dock site control. Also, a layout site is automatically created. It fills the area of the dock site not occupied by the dock panel. Please refer to the layout sites description for details on why it is needed.

Once a dock panel has been created, you can place VCL controls onto it.

Settings of Dock Panels


Dock panels provide a number of settings affecting their appearance and functionality. The image below illustrates the most commonly used. For a complete list of available settings, please refer to the TdxDockPanel class description.

The dock panel in the picture above is displayed with the auto hide feature enabled. This is made to illustrate the ImageIndex property. Note that the image specified by this property is also used when panels are in tab containers. Please refer to the Tab Container Sites topic for details.

Feature Specifics


Caption Buttons

The dock panel’s caption is displayed when the panel is docked to a dock site (or layout site) or when it is within a side container. The ShowCaption property must be set to True for this purpose. The CaptionButtons property specifies which buttons are to be displayed. Note however, that the auto hide button can only be displayed when the panel is not on a float form. The maximize button can only be displayed when the panel is within a side container.

Auto Hide Feature

This feature is available to end-users if the auto hide button is displayed within the panel’s caption. The previous paragraph explains when this button is visible. If the auto hide feature is enabled, the label corresponding to the panel is displayed within the bar at the edge of the host dock site. The label displays the panel’s caption and image. These are specified using the Caption and ImageIndex properties. If there is no image assigned, only the caption string is displayed. Please see the image above for an example of the dock panel’s appearance when the auto hide feature is enabled for it.

See Also