counting lines of textbox

  • Thread starter Thread starter HDB
  • Start date Start date
H

HDB

Ok. I have a windows form with a textbox for displaying certain messages.
Multiline=true and wordwrap=true. I want to know the amount of the lines
currently showing. That should not be any rocket-science, eh?

Textbox.lines.length() only returns the amount of lines ending with a 'hard'
CrLF, not the lines with a 'soft' CrLf done by the wordwrapping option. Why,
I don't know. I don't want to know how much lines are ending with 'hard'
CrLf. I want to know how much lines are currently displayed (and thus
depending on the horizontal size of the textbox). Anyone?
 
Hi Herfried,

IMHO this conflicts with if you dock a textbox or make it in any other way
more sophisticated to the screen.

Therefore I did not want to answer this.

Cor
 
* "Cor Ligthert said:
IMHO this conflicts with if you dock a textbox or make it in any other way
more sophisticated to the screen.

Therefore I did not want to answer this.

?!?

You can convert the soft like breaks into hard line breaks and then
count the number of lines. You don't need to change the content of the
textbox.
 
Back
Top