No of lines in a multi line TextBox ? 
Author Message
 No of lines in a multi line TextBox ?

This only works for "hard" CR, not for automatic word wrap.

Thanks anyway.

Erik

Quote:
>There's no built-in function to get the number of lines, but you can search
>through the .Text property and find each line.  They are separated by a CR
>(10) and a LF (13).  You can do something like this:

>count=0
>temp=text1.text
>do
>    i=instr(temp,vbCrLf)
>    if i=0 then exit do
>    count=count+1
>    temp=mid(temp,i+2)
>loop

>> Is it possible to get the number of lines and the find the new line
>> character between each line in a multiline textbox ?

>> Thanx.

>> Erik

----------------------
Erik P. Vinther
Software Engineer, PM
Kommunedata I-S
Denmark
----------------------


Mon, 11 Oct 1999 03:00:00 GMT  
 No of lines in a multi line TextBox ?

Thanks Doug, i this also works in 32 bit.

Quote:
>NumOfLines = SendMessage(Text1.hWnd, EM_GETLINECOUNT, 0, ByVal 0&)

And thanks to all who participated inthis thread.

Erik

----------------------
Erik P. Vinther
Software Engineer, PM
Kommunedata I-S
Denmark
----------------------



Fri, 15 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Limit a multi-line textbox to 10 lines ?

2. Finding multi-line paragraphs (wrapped lines)

3. Printing other lines from Multi-Line text box

4. Line numbers into multi-line text box

5. ? Text Box: multi line; fixed length per line

6. Orphan Lines of records in multi-line option

7. Multi-line textbox

8. Positon of cursor in multi-line textbox

9. Multi-Line Textbox limits

10. Multi-Line Textbox how to extract pieces of data

11. Handle multi-line in Textbox.

12. Problem with Multi-Line Textbox

 

 
Powered by phpBB® Forum Software