CountLines




Public Const WM_USER = &H400
Public Const EM_GETLINECOUNT = WM_USER + 10
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd _
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

'Funzione


Function ContaLinee (X As TextBox) As Integer
If X.Multiline = True Then
Dim ret As Long
ret=SendMessage (X.hWnd,EM_GETLINECOUNT,0,0)
Contalinee = ret
Else
Contalinee = 1
End If
End Function











( countlines.html )- by Paolo Puglisi - Modifica del 17/12/2023