Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autosize Text Box in Web Form

Status
Not open for further replies.

BrendaD

Programmer
Jan 26, 2001
25
CA
I have looked everywhere and have had no luck in figuring out how to autosize a text box so that it shows all the content whether it is 100 lines or 10 lines.

I have come across the idea of Rich Text Box Editors but don't need anything that elaborate.

Just a simple text box that resizes to accommodate the amount of content.

Am I overlooking something really basic or is it not an option?

Thanks, Brenda
 
I believe a text box has a "Lines" property but I don't know if wrapping creates a new line.

You might want to try something like

textBox1_TextChanged(....)
{
textBox1.Height = (textBox1.Lines * textBox1.Font.Height);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top