Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TextEdit.GetCharFromPosition(Point) Method

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.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