| Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Public Const EM_LINEFROMCHAR = &HC9 'place code in the Change event of your text box 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 |
Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design