Determine current line in a multi-line text box
Determine current line in a multi-line text box
API Declarations
Public Const EM_LINEFROMCHAR = &HC9
Rate Determine current line in a multi-line text box
(2(2 Vote))
Private Sub Text1_Change()
'get the line the cursor is currently on
Dim lngCurrentLine As Long
On Local Error Resume Next
lngCurrentLine = SendMessageLong(Text1.hwnd, EM_LINEFROMCHAR, -1&, 0&) + 1
'for demonstration purposes, display line.
'normally you will create a label and display this info in the label
MsgBox Format$(lngCurrentLine, "##,###")
End Sub
Determine current line in a multi-line text box Comments
No comments yet — be the first to post one!
Post a Comment