MultiLine TextBox, how to remove vertical scrollbar?

O

Olav Tollefsen

I have added a MultiLine TextBox to my aspx page:

<asp:TextBox ID="TextBox1" runat="server" BorderStyle="None" ReadOnly="True"
TextMode="MultiLine"></asp:TextBox>

Then I add two lines of text to it:

TextBox1.Text = "Line 1\r\nLine 2";

The problem is that a vertical scrollbar is displayed

How do I get rid of the vertical scrollbar?

Olav
 
K

Ken Cox [Microsoft MVP]

Hi Olav,

You can use the overflow attribute to turn off the scrollbars:

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

Ken
Microsoft MVP [ASP.NET]
Toronto
 

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

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top