Skip to main content

BaseListBoxControl.IndexFromPoint(Point) Method

Returns the index of an item at specified coordinates.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public int IndexFromPoint(
    Point p
)

Parameters

Name Type Description
p Point

A Point structure containing the coordinates used to obtain the item index.

Returns

Type Description
Int32

An integer value representing the zero-based index of an item at specified coordinates. -1 if no item is found.

Remarks

Use this method to identify the item located at specified coordinates within the control. For example, you can use this method to determine which item within the list is selected when a user right-clicks over the list box control.

The following code snippets (auto-collected from DevExpress Examples) contain references to the IndexFromPoint(Point) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also