BUG: Rich Text Box Control Does Not Word Wrap
Article ID: 167106
Article Last Modified on 12/10/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Control Creation Edition
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q167106
SYMPTOMS
Setting the Multiline property of a Rich Text Box control to True does not
behave as expected. By setting Multiline to True, words should wrap when
they are typed or displayed in a Rich Text Box control. However, they do not.
CAUSE
This behavior occurs only if the RightMargin property of the Rich Text Box
control is set to 0. However, the Help file topic for the RightMargin
property of the RichTextBox control incorrectly states the following:
The default for the RightMargin property is 0 and will cause the
control to set text wrapping equal to the right-most part of the
RichTextBox control so all text is viewable.
RESOLUTION
To work around this behavior, set the RightMargin property to a value
greater than zero. To get the Multiline behavior to work as expected, set
the RightMargin property equal to or slightly less than the Width property
of the Rich Text Box control.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this bug and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
Keywords: kbbug KB167106