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

TdxLayoutContainer.GetHitTest(Integer,Integer) Method

Returns the HitTest object that identifies a visual element at a specified point.

#Declaration

Delphi
function GetHitTest(X: Integer; Y: Integer): TdxCustomLayoutHitTest; overload;

#Parameters

Name Type
X Integer
Y Integer

#Returns

Type
TdxCustomLayoutHitTest

#Remarks

Call this method to determine a visual element located at a specified point (also called the inspected point) passed as method parameters. The inspected point is specified in coordinates relative to the layout control’s top-left corner. If no point is specified (the first overloaded variant is called), the current mouse pointer position is used instead.

The GetHitTest function returns the appropriate HitTest object (a TdxCustomLayoutHitTest descendant) that corresponds to the element located at the inspected point. To determine the element, do one of the following:

  • Compare the returned HitTest object’s class with one of the available HitTest classes;

  • Call the HitTestCode function of the obtained object to get the element’s identifier.

Refer to the How to determine a visual element under the mouse pointer topic to learn how to use the GetHitTest function and HitTest objects.

See Also