Skip to main content

TdxCustomDockControl.OnGetAutoHidePosition Event

Enables you to specify the container edge where the dock control is hidden when its auto hide feature is enabled.

Declaration

property OnGetAutoHidePosition: TdxGetAutoHidePositionEvent read; write;

Remarks

When end-users click the auto hide button of a dock control or when its AutoHide property is set to True, the auto hide feature is enabled. A label corresponding to the control is then displayed at the nearest edge of the container. Using the mouse over this label makes the control visible. When the mouse pointer is not over this label or the control’s area, the control is hidden.

The OnGetAutoHidePosition event enables you to determine the edge where the label corresponding to the hidden control will appear. The Sender parameter represents the control whose auto hide feature is enabled. The APosition parameter specifies the edge of the container where the control must be hidden. Read this parameter value to identify the edge currently assigned. If you need to specify a different edge, set the appropriate value.

The following sample code uses the OnGetAutoHidePosition event handler. It prevents the control from being hidden next to the top and right edges of the container. If the position automatically specified is the top edge, the control is then hidden to the left edge. If the right edge is specified automatically, the control is hidden to the bottom edge.

procedure TForm1.dxDockPanel1GetAutoHidePosition(Sender: TdxCustomDockControl; var APosition: TdxAutoHidePosition);
begin
  if APosition = ahpTop then
    APosition := ahpLeft;
  if APosition = ahpRight then
    APosition := ahpBottom;
end;
See Also