This document is archived and information here might be outdated.  Recommended version.


IToolbarControl2.HitTest Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControl2 Interface > IToolbarControl2.HitTest Method
ArcGIS Developer Help

IToolbarControl2.HitTest Method

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
);
[C++]
HRESULT HitTest(
  long X,
  long Y,
  VARIANT_BOOL nearest
);
[C++]
Parameters
X [in]

X is a parameter of type long Y [in]
Y is a parameter of type long nearest [in, optional, defaultvalue()]
nearest is a parameter of type bool

Product Availability

Available with ArcGIS Engine.

Description

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.

See Also

IToolbarControl2 Interface