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


IToolbarControl2.HitTest Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Controls)  

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#]

Optional Values

nearest   Supply false as a default value.
[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

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