Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomDockControl.AutoHideHostSite Property

Returns the dock site controlling the dock control’s auto hide functionality.

#Declaration

Delphi
property AutoHideHostSite: TdxDockSite read;

#Property Value

Type
TdxDockSite

#Remarks

Panels, tab containers and side containers support an auto hide feature. To enable it, set the AutoHide property of the dock control to True. Once this has been done, showing/hiding the dock control is controlled by the dock site referenced by its AutoHideHostSite property. You can use the ShowingControl property of the site returned by this property to show and hide the control (or its children) programmatically.

Note that if the control’s AutoHideHostSite property returns nil, the control’s auto hide feature cannot be enabled. This occurs, for instance, if the dock control is on a float site.

Note

if a dock panel is within a container whose auto hide feature is enabled, assigning the panel to the ShowingControl property of the host dock site will have no effect. You should assign the owning container to this property instead. To access the control whose auto hide feature is actually enabled, use the AutoHideControl property of a dock control.

You can handle the OnShowControl and OnHideControl events of the site returned by the AutoHideHostSite property to respond to showing and hiding the dock control.

The following sample code shows how to use the AutoHideHostSite property. It shows and hides the help panel (TdxDockPanel control) in response to pressing the F1 key. The OnKeyDown event of the form is handled in response to key pressing. The same handler can be assigned to the OnKeyDown event of any control.

Delphi
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key <> VK_F1 then Exit;
  if not HelpPanel.AutoHide then Exit;
  // toggling the panel's visibility
  with HelpPanel.AutoHideHostSite do
  begin
    if ShowingControl = nil then
      ShowingControl := HelpPanel
    else
      ShowingControl := nil;
  end;
end;
See Also