Get the line number in Edit control
-
20-09-2019 - |
Question
how can you get the current line number in a multi-line edit control?
Solution
From the docs for EM_LINEFROMCHAR
, if you pass -1
as wParam
, you get the line number of the line containing the caret (or the start of the selection if there is one).
OTHER TIPS
Look at the EM_LINEFROMCHAR
window message.
Did you try checking the MSDN index for anything beginning with EM_*. If you did, you'd find EM_LINEFROMCHAR, EM_LINEINDEX, EM_LINELENGTH, etc, which can probably solve your problem
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow