- Home
·
- String Manipulation
·
- This snippet explaines the use of SendMessageA API of user32 library, to get number of lines in a t
This snippet explaines the use of SendMessageA API of user32 library, to get number of lines in a t
This snippet explaines the use of SendMessageA API of user32 library, to get number of lines in a textbox. The line count is obtained from the
API Declarations
'WebSite: http://www.prashantsharma.com
'EMail: [email protected]
'You can declare the API function and the constant value in the form itself
'as PRIVATE or in a module as PUBLIC
Private Declare Function SendMessageA Lib "user32" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const EM_GETLINECOUNT = &HBA
Rate This snippet explaines the use of SendMessageA API of user32 library, to get number of lines in a t
(1(1 Vote))
'the count as a return value for a function
Public Function LineCountInText1() As Long
Dim lCount As Long
lCount = SendMessageA(Text1.hWnd, EM_GETLINECOUNT, 0&, 0&) 'This is all we need to do, Result will be the count of lines
LineCountInText1 = lCount 'Use the count
End Function
This snippet explaines the use of SendMessageA API of user32 library, to get number of lines in a t Comments
No comments yet — be the first to post one!
Post a Comment