How do I disable scrollbars on a multiline textbox?

G

Google Jenny

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
 
J

Jos

Google said:
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;"
 
G

Google Jenny

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
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top