Skip to main content
All docs
V24.1

TextEdit.GetCharFromPosition(Point) Method

Retrieves the character that is closest to the specified location within the control.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual char GetCharFromPosition(
    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
Char

The character closest to the specified location.

Remarks

You can use this method to determine which characters are located near a specific point within the control.

If the location specified in the pt parameter is outside the control’s client area, the GetCharFromPosition method returns the first character of the string closest to the specified point.

Note

If the target point is on the right side of the control’s client area, the method returns the last character of the string closest to the specified point.

See Also