by Syed Danish Afzal Rizvi (13 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 20th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Count the number of lines in a text box.
API Declarations
Const EM_GETLINECOUNT = &HBA
Dim cntln As Long
On Error Resume Next
cntln = SendMessageLong(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&) 'Counting Lines
Label1.Caption = Format$(cntln , "##,###") 'Formating Label Control
End Sub