Skip to main content
All docs
V24.1

TextEdit.GetCharIndexFromPosition(Point) Method

Retrieves the index of the character closest to the specified location.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual int GetCharIndexFromPosition(
    Point pt
)

Parameters

Name Type Description
pt Point

The location (relative to the control’s top left corner) from which to find the nearest character.

Returns

Type Description
Int32

The zero-based index of the character closest to the specified location.

Remarks

This method returns the index of the chacacter that is closest to the position specified in the pt parameter.

Note

If the specified location is not within the control’s client rectangle, or is beyond the editor’s last character, the return value is the index of the last character.

See Also