Skip to main content
All docs
V26.1
  • TextEdit.GetCharIndexFromPosition(Point) Method

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

    Namespace: DevExpress.XtraEditors

    Assembly: DevExpress.XtraEditors.v26.1.dll

    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