TdxLayoutContainer.GetHitTest(Integer,Integer) Method
Returns the HitTest object that identifies a visual element at a specified point.
Declaration
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.