H
HDB
Thanks for the responses in a former thread about getting the count of lines
in a multiline textbox with wordwrap.
After some tinkering, I found the solution (based on a VB6 solution, had to
modify a bit for VB.NET):
<DllImport("user32.dll")> Private Shared Function SendMessage(ByVal hWnd As
IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32)
As Int32
End Function
Dim EM_GETLINECOUNT As Long = &HBA&
Dim lineCount As Int32 = SendMessage(txtBox.Handle, EM_GETLINECOUNT, 0, 0&)
Works like a charm.
in a multiline textbox with wordwrap.
After some tinkering, I found the solution (based on a VB6 solution, had to
modify a bit for VB.NET):
<DllImport("user32.dll")> Private Shared Function SendMessage(ByVal hWnd As
IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32)
As Int32
End Function
Dim EM_GETLINECOUNT As Long = &HBA&
Dim lineCount As Int32 = SendMessage(txtBox.Handle, EM_GETLINECOUNT, 0, 0&)
Works like a charm.