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

TdxDockingController.GetDockControlAtPos(TPoint) Method

Returns the dock control located at the specified screen coordinates.

#Declaration

Delphi
function GetDockControlAtPos(const P: TPoint): TdxCustomDockControl;

#Parameters

Name Type
P TPoint

#Returns

Type
TdxCustomDockControl

#Remarks

Use the GetDockControlAtPos method to obtain the dock control located at the specified coordinates. The coordinates are specified relative to the top-left corner of the screen via the pt parameter.

First, the GetDockControlAtPos method obtains the control at the specified point. If the control is a dock control or it has a dock control as a parent, the dock control found is returned. If it is not a dock control and doesn’t have such a parent, the GetDockControlAtPos method returns nil.

The code below shows how to obtain the dock panel currently located under the mouse pointer. The OnTimer event of the timer component is handled for this purpose. This can be used, for instance, to display explanatory information about the panel where the mouse is hovering.

Delphi
procedure TForm1.Timer1Timer(Sender: TObject);
var DockControl: TdxCustomDockControl;
begin
  DockControl := dxDockingController.GetDockControlAtPos(Mouse.CursorPos);
  if DockControl = nil then Exit;
  if DockControl is TdxDockPanel then
  begin
    // perform actions on the panel found here
    // ...
  end;
end;
See Also