HeaderPane
Main
Hide
Share Link
Print

HitTest Method, SftButton Object

Determines the area at a given location.

Syntax

C#bool Success = object.HitTest(float x, float y, out SftButtonAreaConstants Area);
VB.NETSuccess = object.HitTest(ByVal x As Single, ByVal y As Single, ByRef Area As SftButtonAreaConstants) As Boolean
C++VARIANT_BOOL Success = object->HitTest(float x, float y, enum SftButtonAreaConstants* Area);
CHRESULT object->raw_HitTest(float x, float y, enum SftButtonAreaConstants* Area, VARIANT_BOOL* Success);
VBSuccess = object.HitTest(ByVal x As Single, ByVal y As Single, Area As SftButtonAreaConstants) As Boolean

object

A SftButton object.

x

An expression that evaluates to the x-coordinate to be tested. The units used depend on the container used (e.g., Visual Basic uses TWIPS by default, Visual C++ uses pixels).

y

An expression that evaluates to the y-coordinate to be tested. The units used depend on the container used (e.g., Visual Basic uses TWIPS by default, Visual C++ uses pixels).

Area

Returns a value describing the area where the coordinates x, y are located.

NameValueDescription
areaSftButtonButton0The coordinates are located within the button portion.
areaSftButtonDropDown1The coordinates are located within the drop down button portion.

Success

Returns True if the coordinates x, y are located within the control.

Comments

The HitTest method determines the area at a given location.

The general area where the coordinates, described by x, are located in the control (relative to the top, left corner of the control) is returned in Area.

HitTest uses the units native to the container application (e.g., Visual Basic uses TWIPS by default, Visual C++ uses pixels). HitTestPix always uses pixels. HitTestV should be used when using Internet Explorer.

See Also SftButton Object | Object Hierarchy


Last Updated 11/03/2026 - (email)
© 2026 Softel vdm, Inc.