Multiline TextBox Scroll Bars

P

Paul J. Lay

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
 
K

Ken Cox [Microsoft MVP]

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]
 
P

Paul J. Lay

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 said:
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 said:
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
 
K

Ken Cox [Microsoft MVP]

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 said:
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 said:
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 said:
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
 
S

Steven Cheng[MSFT]

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top