This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControl2 Interface > IToolbarControl2.HitTest Method (ArcObjects .NET 10.4 SDK) |
Returns the index of the item at the specified x and y coordinates.
[Visual Basic .NET] Public Function HitTest ( _ ByVal X As Integer, _ ByVal Y As Integer, _ [ByVal nearest As Boolean] _ ) As Integer
[C#] public int HitTest ( int X, int Y, bool nearest );
Optional Values
[C++]
HRESULT HitTest(
long X,
long Y,
VARIANT_BOOL nearest,
long* index
);
[C++]
Parameters X [in] X is a parameter of type long Y [in] Y is a parameter of type long nearest [in, optional, defaultvalue(VARIANT_FALSE)] nearest is a parameter of type VARIANT_BOOL index [out, retval] index is a parameter of type long
Returns the index of the item at the specified x and y coordinates (in pixels). If no item is found, returns -1.
nearest specifies whether the index of the item nearest to the specified x and y coordinates is returned. By default nearest is false.