MultiLine TextBox, how to remove vertical scrollbar?

Discussion in 'ASP .Net' started by Olav Tollefsen, Jan 29, 2005.

  1. 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
     
    Olav Tollefsen, Jan 29, 2005
    #1
    1. Advertising

  2. 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


    "Olav Tollefsen" <> wrote in message
    news:OXsiZ$...
    >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
    >
     
    Ken Cox [Microsoft MVP], Jan 29, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. r pasadhy via .NET 247

    positioning vertical scrollbar

    r pasadhy via .NET 247, Aug 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,140
    Joe Fallon
    Aug 12, 2004
  2. SJ
    Replies:
    1
    Views:
    1,640
    Kevin Spencer
    Jan 11, 2006
  3. Don Schneider
    Replies:
    0
    Views:
    2,011
    Don Schneider
    Jun 27, 2003
  4. Avi
    Replies:
    3
    Views:
    1,362
    Nathan Sokalski
    Aug 28, 2008
  5. dale zhang
    Replies:
    8
    Views:
    428
    Tintin
    Nov 30, 2004
Loading...

Share This Page