|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi !
Can any one tell how to count the lines in a text box... please.. Aj |
|
#2
|
|||
|
|||
|
i haven't tried this but I think you need to count the number
of line breaks of the text in the textbox. This should be dependant on the language used. If it is HTML you would be looking for <BR> If it is another language such as C#/C++, you would be looking for \n or similar. Read this here http://www.csharpfriends.com/Articl...px?articleID=29 for this. I think this would work for both VB .Net and C#. In VB [.Net], it is something like vbCrLf (can't remember exactly what it's like) Also try using regular expressions. |
|
#3
|
|||
|
|||
|
One quick way that should work, although maybe not the most efficient, is to split the text on line breaks
LineArray = Split(text1.text, vbCrLf) NumLines = Ubound(LineArray) ' You may need to add or subtract 1, arrays count from 0
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Text Box Line Count |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|