MultiLine TextBox, how to set height?

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
 
O

Olav Tollefsen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top