MultiLine TextBox, how to set height?

  • Thread starter Thread starter Olav Tollefsen
  • Start date Start date
O

Olav Tollefsen

I have a MultiLine TextBox to which I add text like this:

TextBox1.Attributes.Add("style","overflow :hidden");
TextBox1.Text = "Line 1\r\nLine 2\r\nLine 3";

The number of lines added to the TextBox can be variable.

Right now (without setting any width / height), I can only see two lines of
text. If I click with the mouse in the TextBox, I can see the rest of the
text by moving the the mouse inside the TextBox.

How can I set the height / width of the TextBox to be exactly right to
display all the content?

Olav
 
I found that it was better to use a Label and this code instead:

Label1.Text = "Line 1<br />Line 2<br />Line 3";

Olav
 
Back
Top