nashuald
asked on
Number of lines in a multiline textbox
How can I get the number of lines typed in a multiline textbox control?
http://www.developerfusion.co.uk/show/1607/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or if you want a very un-orthodox method:
dim strString as string
dim numLines as integer
dim myArray() as string
strString = text1.text
myArray() = Split(strString,vbcrlf)
numLines = myArray.UBound
msgbox "The text box has : " & numLines & " Lines"
I do not recommend using this method in any commerical application.
Brian
dim strString as string
dim numLines as integer
dim myArray() as string
strString = text1.text
myArray() = Split(strString,vbcrlf)
numLines = myArray.UBound
msgbox "The text box has : " & numLines & " Lines"
I do not recommend using this method in any commerical application.
Brian
Brian: the split method only returns the number of hard breaks (via the crlf characters), but not those lines that are wrapped by the length of the line...
angelIII: You are very right.
I was just providing it as an example. Nothing more. I would never recommmend anything like that in a serious application.
Brian
I was just providing it as an example. Nothing more. I would never recommmend anything like that in a serious application.
Brian
ASKER
Thank's everybody!