Multiline TextBox Scroll Bars

Discussion in 'ASP .Net Web Controls' started by Paul J. Lay, Nov 23, 2004.

  1. Paul J. Lay

    Paul J. Lay Guest

    Is there any way to get rid of the scroll bars on a multiline TextBox. I
    don't see an attribute for that in the Web Form textbox properties. Please
    advise. Thanks for your help.

    Best Regards,

    Paul J. Lay
    Paul J. Lay, Nov 23, 2004
    #1
    1. Advertising

  2. Hi Paul,

    This is a style property that you can add on your own as an attribute.
    You're looking for overflow:hidden like this:

    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    TextBox1.Attributes.Add("style", "overflow:hidden")
    End Sub

    Here's the Textbox itself:

    <asp:textbox id="TextBox1" runat="server" Width="264px"
    Height="160px" TextMode="MultiLine">The property is read/write for all
    objects except the following, for which it is read-only: currentStyle. The
    property has a default value of visible for all objects with the exception
    of TEXTAREA which has a default value of auto. The Cascading Style Sheets
    (CSS) attribute is not inherited.
    Setting the overflow property to hidden on a textArea object hides its
    scroll bars.
    </asp:textbox>

    http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/overflow.asp


    Does this help?

    Ken
    Microsoft MVP [ASP.NET]

    "Paul J. Lay" <> wrote in message
    news:...
    > Is there any way to get rid of the scroll bars on a multiline TextBox. I
    > don't see an attribute for that in the Web Form textbox properties.
    > Please
    > advise. Thanks for your help.
    >
    > Best Regards,
    >
    > Paul J. Lay
    >
    >
    Ken Cox [Microsoft MVP], Nov 24, 2004
    #2
    1. Advertising

  3. Paul J. Lay

    Paul J. Lay Guest

    Hi Ken! This did not help me. The style overflow:hidden gets rid of the
    scroll bars but it also hides the entire textbox. I just wanted to get rid
    of the scroll bars not the entire textbox. Can you tell me where the
    textbox styles are documented. Thanks for your help. Hope you had a nice
    Thanksgiving holiday.

    Best Regards,

    Paul J. Lay


    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:O%...
    > Hi Paul,
    >
    > This is a style property that you can add on your own as an attribute.
    > You're looking for overflow:hidden like this:
    >
    > Private Sub Page_Load _
    > (ByVal sender As System.Object, _
    > ByVal e As System.EventArgs) _
    > Handles MyBase.Load
    > TextBox1.Attributes.Add("style", "overflow:hidden")
    > End Sub
    >
    > Here's the Textbox itself:
    >
    > <asp:textbox id="TextBox1" runat="server" Width="264px"
    > Height="160px" TextMode="MultiLine">The property is read/write for all
    > objects except the following, for which it is read-only: currentStyle. The
    > property has a default value of visible for all objects with the exception
    > of TEXTAREA which has a default value of auto. The Cascading Style Sheets
    > (CSS) attribute is not inherited.
    > Setting the overflow property to hidden on a textArea object hides its
    > scroll bars.
    > </asp:textbox>
    >
    >

    http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/overflow.asp
    >
    >
    > Does this help?
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    >
    > "Paul J. Lay" <> wrote in message
    > news:...
    > > Is there any way to get rid of the scroll bars on a multiline TextBox.

    I
    > > don't see an attribute for that in the Web Form textbox properties.
    > > Please
    > > advise. Thanks for your help.
    > >
    > > Best Regards,
    > >
    > > Paul J. Lay
    > >
    > >

    >
    Paul J. Lay, Nov 30, 2004
    #3
  4. Hi Paul,

    That's odd, because it works for me. The text appears with no scrollbars but
    you can use the cursor to navigate down to the text that is outside the box.


    <asp:textbox id="TextBox1" runat="server" Width="264px"
    Height="160px" TextMode="MultiLine">The property is read/write for all
    objects except the following, for which it is read-only: currentStyle. The
    property has a default value of visible for all objects with the exception
    of TEXTAREA which has a default value of auto. The Cascading Style Sheets
    (CSS) attribute is not inherited.
    Setting the overflow property to hidden on a textArea object hides its
    scroll bars.
    </asp:textbox>

    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    TextBox1.Attributes.Add("style", "overflow:hidden")
    End Sub

    Ken
    "Paul J. Lay" <> wrote in message
    news:e%...
    > Hi Ken! This did not help me. The style overflow:hidden gets rid of the
    > scroll bars but it also hides the entire textbox. I just wanted to get
    > rid
    > of the scroll bars not the entire textbox. Can you tell me where the
    > textbox styles are documented. Thanks for your help. Hope you had a
    > nice
    > Thanksgiving holiday.
    >
    > Best Regards,
    >
    > Paul J. Lay
    >
    >
    > "Ken Cox [Microsoft MVP]" <> wrote in message
    > news:O%...
    >> Hi Paul,
    >>
    >> This is a style property that you can add on your own as an attribute.
    >> You're looking for overflow:hidden like this:
    >>
    >> Private Sub Page_Load _
    >> (ByVal sender As System.Object, _
    >> ByVal e As System.EventArgs) _
    >> Handles MyBase.Load
    >> TextBox1.Attributes.Add("style", "overflow:hidden")
    >> End Sub
    >>
    >> Here's the Textbox itself:
    >>
    >> <asp:textbox id="TextBox1" runat="server" Width="264px"
    >> Height="160px" TextMode="MultiLine">The property is read/write for all
    >> objects except the following, for which it is read-only: currentStyle.
    >> The
    >> property has a default value of visible for all objects with the
    >> exception
    >> of TEXTAREA which has a default value of auto. The Cascading Style Sheets
    >> (CSS) attribute is not inherited.
    >> Setting the overflow property to hidden on a textArea object hides its
    >> scroll bars.
    >> </asp:textbox>
    >>
    >>

    > http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/overflow.asp
    >>
    >>
    >> Does this help?
    >>
    >> Ken
    >> Microsoft MVP [ASP.NET]
    >>
    >> "Paul J. Lay" <> wrote in message
    >> news:...
    >> > Is there any way to get rid of the scroll bars on a multiline TextBox.

    > I
    >> > don't see an attribute for that in the Web Form textbox properties.
    >> > Please
    >> > advise. Thanks for your help.
    >> >
    >> > Best Regards,
    >> >
    >> > Paul J. Lay
    >> >
    >> >

    >>

    >
    >
    Ken Cox [Microsoft MVP], Nov 30, 2004
    #4
  5. Hi Paul,

    I've also tested Ken's means and it works. For a simple test, you can just
    use the
    html <textarea> to apply the "overflow:hidden" style on:

    <textarea style="overflow:hidden" rows="10" cols="20">
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    ddddddddddddddddddddddd
    </textarea>

    Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support
    Steven Cheng[MSFT], Dec 1, 2004
    #5
    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. S. Justin Gengo

    Re: DIVs and overflow scroll bars

    S. Justin Gengo, Jul 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    406
    S. Justin Gengo
    Jul 18, 2003
  2. rf
    Replies:
    0
    Views:
    424
  3. UJ
    Replies:
    1
    Views:
    558
    John Timney \(MVP\)
    Nov 1, 2006
  4. active

    Can't get textbox to display scroll bars

    active, Apr 7, 2007, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    162
    active
    Apr 7, 2007
  5. dale zhang
    Replies:
    8
    Views:
    409
    Tintin
    Nov 30, 2004
Loading...

Share This Page