RichTextBox horizontal scrolling not working

I have one readOnly RichTextBox line with wordWrap disabled, and I add one very long line of text programmatically.

However, the horizontal scrollBar does not appear even if I set the ScrollBars to ForcedHorizontal .

How can i fix this?

I can navigate the entire line if I use the arrow keys on the keyboard, but this only makes the situation worse.

+7
source share
4 answers

I can reproduce this behavior with

 MultiLine = false 

If I change this property to True, the scroll bar will appear as expected

+5
source

Try to solve this problem with

  Multiline = True WordWrap = False 

Change these properties to enable multi-line function as well as enable horizontal scrolling.

+5
source

I ran into a vertical scrollbar issue. If the Rich text box is inside any control, such as TabPage, etc., then in this situation you need to set dock == fill for RickTextbox.

0
source

You must set the Multiline property to true. Check this text from MSDN:

Display scrollbars in a RichTextBox control Set the Multiline property to true. No type of scroll bar, including horizontal, will be displayed if the Multiline property is set to false.

Set the ScrollBars property to the appropriate value of the RichTextBoxScrollBars enumeration.

0
source

All Articles