Results 1 to 1 of 1

Thread: RichTextBox only scrolls after recieving focus?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2003
    Location
    Seattle, WA
    Posts
    17

    RichTextBox only scrolls after recieving focus?

    Hi, I was wondering if anyone else noticed this, and hopefully if someone has a solution.

    If you want to scroll an rtf box, I have found it will not budge unless you give it focus:

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         RichTextBox1.AppendText(" MOO " & vbCrLf)
    3.         RichTextBox1.Focus()
    4.         Button1.Focus()
    5.     End Sub
    6.  
    7.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    8.         RichTextBox1.Text &= " MOO " & vbCrLf
    9.         RichTextBox1.SelectionStart = RichTextBox1.TextLength
    10.         RichTextBox1.ScrollToCaret()
    11.         RichTextBox1.Focus()
    12.         Button1.Focus()
    13.     End Sub
    To me it sounds like a framework bug, as I cannot see a single reason why anyone would want it like this. Ive tried a few API calls but not a single one seems to be doing anything.

    Thanks in advance for your help.
    Last edited by FireRabbit; Feb 2nd, 2003 at 12:00 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width