|
-
Jan 13th, 2000, 01:19 PM
#1
Thread Starter
Addicted Member
is it possible to tell how many lines down on a multiline textbox, the text goes? Let me rephrase that if it was confusing, how can i tell how far the text goes down on a textbox? (eg. 3 lines)For example, i am typing this out, and the text has wrapped to make 7 lines. any help?
-
Jan 13th, 2000, 03:56 PM
#2
Sure, the following code show you how to count the number of lines in a textbox.
If you want more information please red my article, Extending the TextBox Control here at VB-World.
Public Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Const EM_GETLINECOUNT = &HBA
Public Function LineCount(txtBox As TextBox) As Long
LineCount = SendMessage( _
TxtBox.hWnd, EM_GETLINECOUNT, 0&, 0&)
End Function
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Jan 13th, 2000, 09:25 PM
#3
Thread Starter
Addicted Member
Thanks, how would I make it preform a certain task when it has reached, say line 15?
-
Jan 13th, 2000, 09:33 PM
#4
Hyperactive Member
Code:
If LineCount(text1) = 15 then
'do task
end if
Put this in the change event of the textbox or something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|