Text in RichTextBox scrolls out of "sight" ...

  • Thread starter Thread starter Joe HM
  • Start date Start date
J

Joe HM

Hello -

I have a GUI that uses a RichTextBox to output text. The problem is
that if this box ouput text while hidden behind another window, it is
blank when I bring it to the foreground. The text is there when I
click on the scroll button on the scrollbar but it seems to be scrolled
"up" all the way.

The following code is used to add new text to that box with a certain
color:

Dim lTextLength As Integer = aRichTextBox.TextLength()

' The following will append aString in aColor to the Text of the
' aRichTextBox.

aRichTextBox.Select(lTextLength, 0)

aRichTextBox.SelectionColor = aColor
aRichTextBox.SelectedText = aString

' This will set the cursor to the end of the text so that it
' scrolls and becomes visible.

aRichTextBox.Select(aRichTextBox.TextLength(), 0)

The last line of code is something I added hoping it would show the
text.

Is this a problem with the RichTextBox or am I doing something wrong
when I add text to the box?

Thanks!
Joe
 
Back
Top