Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display scroll bar in textbox when contents are beyond the bounds C#

Is it possible to show/hide the scroll bar in a text box only when the line count in the text box is more than the number of lines displayed?

like image 497
Anders Avatar asked Sep 10 '09 21:09

Anders


People also ask

How do I make my scrollbar only appear when overflow?

Use overflow: auto . Scrollbars will only appear when needed. (Sidenote, you can also specify for only the x, or y scrollbar: overflow-x: auto and overflow-y: auto ).

How do I get a scrollbar for a div?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

What CSS rule will cause a scroll bar appear when the content of an HTML element exceeds its height or width?

Definition and Usage. The overflow-x property specifies whether to clip the content, add a scroll bar, or display overflow content of a block-level element, when it overflows at the left and right edges.


1 Answers

Consider using the RichTextBox -- it has that behavior built in.

like image 178
Austin Salonen Avatar answered Oct 17 '22 23:10

Austin Salonen