Add Horizonal Scroll Bar To Rich Text box

'Add 1 Rich Text Box to your Form. Set the Rich Text Box Scrollbars property to
'1 (for only horizonal scroll bar) or to 3 (for both horizonal and vertical).
'Insert the following code to your form:

Private Sub Form_Load()
'The size of the 'RichTextBox1.RightMargin' determine the size of the horizonal
'scroll bar. Increase/Decrease the '10000' below to Reduce/Enlarge the Horizonal
'scroll bar size. if the 'RichTextBox1.RightMargin' will be equal to 'RichTextBox1.Width'
'there will be no horizonal scroll bar
.
RichTextBox1.RightMargin = RichTextBox1.Width + 10000
End Sub

Go Back