CEdit.PosFromCharmethod
Retrieves the client area coordinates of a specified character in an edit control.
Syntax
FUNCTION PosFromChar (BYVAL hEdit AS HWND, BYVAL index AS LONG) AS LONG
Parameters
| Name | Description | |
|---|---|---|
hEdit | The handle of the edit control. | |
index | The zero-based index of the character. |
Return value
The return value contains the client area coordinates of the character. The LOWORD contains the horizontal coordinate and the HIWORD contains the vertical coordinate.
Description
Retrieves the client area coordinates of a specified character in an edit control.
Remarks
A returned coordinate can be a negative value if the specified character is not displayed in the edit control's client area. The coordinates are truncated to integer values.
If the character is a line delimiter, the returned coordinates indicate a point just beyond the last visible character in the line. If the specified index is greater than the index of the last character in the control, the control returns -1.
Reference
- Include file
CEdit.inc - Defined in AfxNova/CEdit.inc:518
- Documented in Windows/WIndows Controls/CEdit Class.md
- Topic: CEdit Class