How to: Display Scroll Bars in the Windows Forms RichTextBox Control
By default, the Windows Forms RichTextBox control displays horizontal and vertical scroll bars as necessary. There are seven possible values for the ScrollBars property of the RichTextBox control, which are described in the table below.
To display scroll bars in a RichTextBox control
Set the Multiline property to true. No type of scroll bar, including horizontal, will display if the Multiline property is set to false.
Set the ScrollBars property to an appropriate value of the RichTextBoxScrollBars enumeration.
Value
Description
Both (default)
Displays horizontal or vertical scroll bars, or both, only when text exceeds the width or length of the control.
Never displays any type of scroll bar.
Displays a horizontal scroll bar only when the text exceeds the width of the control. (For this to occur, the WordWrap property must be set to false.)
Displays a vertical scroll bar only when the text exceeds the height of the control.
Displays a horizontal scroll bar when the WordWrap property is set to false. The scroll bar appears dimmed when text does not exceed the width of the control.
Always displays a vertical scroll bar. The scroll bar appears dimmed when text does not exceed the length of the control.
Always displays a vertical scrollbar. Displays a horizontal scroll bar when the WordWrap property is set to false. The scroll bars appear grayed when text does not exceed the width or length of the control.
Set the WordWrap property to an appropriate value.
Value
Description
false
Text in the control is not automatically adjusted to fit the width of the control, so it will scroll to the right until a line break is reached. Use this value if you chose horizontal scroll bars or both, above.
true (default)
Text in the control is automatically adjusted to fit the width of the control. The horizontal scrollbar will not appear. Use this value if you chose vertical scroll bars or none, above, to display one or more paragraphs.