Click here to Skip to main content
15,921,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display total lines at the bottom of multiline text box.

People suggest following
//to find number of lines
int lines = textBox1.Lines.Length;
//to find number of words
int words = textBox1.Text.Length;


But visual studio does not recognize lines.
Do i need add reference ?

or any idea

Thanks
Posted

1 solution

wrote:
People suggest following
//to find number of lines
int lines = textBox1.Lines.Length;


I'm not sure what they are smoking. That's just plain not going to work, it's made up.

First google hit[^] - looks like a decent method to me.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900