How do I disable scrollbars on a multiline textbox?

Discussion in 'ASP .Net Web Controls' started by Google Jenny, Oct 1, 2004.

  1. Google Jenny

    Google Jenny Guest

    Hi, folks.

    When I make a textbox multiline (by setting its TextMode property to
    MultiLine) I automatically get scrollbars.

    There is no scrollbar property on the TextBox control. It's simply not
    one of the choices.

    Yet, poking around on the net, I find that some people (or versions of
    .NET?) do allow this, as in this code snippet I found:

    [C#]
    public void CreateMyMultilineTextBox()
    {

    // Set the Multiline property to true.
    TextBox1.Multiline = true;

    // Add vertical scroll bars to the TextBox control.
    TextBox1.ScrollBars = ScrollBars.Vertical;

    }


    I would like to be able to code: TextBox1.Scrollbars = ScrollBars.None;

    But Scrollbars is not on the property menu for my text box.

    Any help greatly appreciated!

    Thanks,
    Google Jenny



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Google Jenny, Oct 1, 2004
    #1
    1. Advertising

  2. Google Jenny

    Jos Guest

    Google Jenny wrote:
    > Hi, folks.
    >
    > When I make a textbox multiline (by setting its TextMode property to
    > MultiLine) I automatically get scrollbars.
    >
    > There is no scrollbar property on the TextBox control. It's simply not
    > one of the choices.
    >
    > Yet, poking around on the net, I find that some people (or versions of
    > NET?) do allow this, as in this code snippet I found:
    >
    > [C#]
    > public void CreateMyMultilineTextBox()
    > {
    >
    > // Set the Multiline property to true.
    > TextBox1.Multiline = true;
    >
    > // Add vertical scroll bars to the TextBox control.
    > TextBox1.ScrollBars = ScrollBars.Vertical;
    >
    > }


    Probably, the above is code for Windows Forms.

    Use this attribute for your textbox:
    style="overflow:hidden;"

    --

    Jos Branders
     
    Jos, Oct 2, 2004
    #2
    1. Advertising

  3. Google Jenny

    Google Jenny Guest

    Hi, Jos. Thanks for responding.

    I couldn't set that attribute in the Properties window for the textbox,
    so I tried setting it directly in the HTML. That didn't work. Then I
    tried dropping the textbox inside an HTML label and setting that
    attribute in the HTML for the label. That didn't work. I'm stumped, I
    must confess.

    I don't understand why it's so easy to manipulate these attributes in
    Windows forms and so difficult in Web forms.

    Google Jenny




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Google Jenny, Oct 6, 2004
    #3
    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. =?Utf-8?B?RGFuIFNpa29yc2t5?=

    HOWTO: Use multiline asp:texbox scrollbars on panel that is disabl

    =?Utf-8?B?RGFuIFNpa29yc2t5?=, Apr 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    492
    =?Utf-8?B?RGFuIFNpa29yc2t5?=
    Apr 11, 2006
  2. msnews.microsoft.com

    TextBox and Scrollbars

    msnews.microsoft.com, Jan 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    213
    Ken Cox [Microsoft MVP]
    Jan 3, 2005
  3. John McCrae

    TextBox and Scrollbars

    John McCrae, Jan 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    125
    John McCrae
    Jan 2, 2005
  4. Raja Kannan

    can't disable scrollbars for certain websites

    Raja Kannan, Aug 4, 2004, in forum: Javascript
    Replies:
    0
    Views:
    118
    Raja Kannan
    Aug 4, 2004
  5. dale zhang
    Replies:
    8
    Views:
    458
    Tintin
    Nov 30, 2004
Loading...

Share This Page