How to get the no of lines in a richtextbox [modified]
-
I have a for next loop which forms an integral part of my app ,it uses the no of lines in a richtextbox , but whenever i run it on the debugger i get that 1 is greater than
RichTextBox.Lines.Length
,so is there any other way to get the proper no of lines in the richtextbox????:mad::mad::mad::mad::mad: -
I have a for next loop which forms an integral part of my app ,it uses the no of lines in a richtextbox , but whenever i run it on the debugger i get that 1 is greater than
RichTextBox.Lines.Length
,so is there any other way to get the proper no of lines in the richtextbox????:mad::mad::mad::mad::mad:RichTextBox1.Lines.Length
-
I have a for next loop which forms an integral part of my app ,it uses the no of lines in a richtextbox , but whenever i run it on the debugger i get that 1 is greater than
RichTextBox.Lines.Length
,so is there any other way to get the proper no of lines in the richtextbox????:mad::mad::mad::mad::mad:The only way to do it is RTB.Lines.Length. What "proper" refers to depends on the definition of the word and put forth by the person demanding it. What do you mean when you use "proper" in this context? A line in a RTB can be many screen-lines long. To the RTB, it's a string of text that ends with a CarriageReturn character.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
The only way to do it is RTB.Lines.Length. What "proper" refers to depends on the definition of the word and put forth by the person demanding it. What do you mean when you use "proper" in this context? A line in a RTB can be many screen-lines long. To the RTB, it's a string of text that ends with a CarriageReturn character.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007I found a solution , i changed the code from
For index = 0 to RTB.Length
toFor Each String in RTB.Lines()
and it started working,what i meant by proper was,irrespective of the no of lines in the rtb ,rtb.length always returned 0 ,now that i've resolved it i don't think it really matters