Results 1 to 4 of 4

Thread: ScrollToCaret() not working?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    ScrollToCaret() not working?

    i am using a richtextbox and have the following code:
    VB Code:
    1. clientLogTxtBox.SelectionLength = 0
    2. clientLogTxtBox.SelectionStart = clientLogTxtBox.Text.Length
    3. clientLogTxtBox.ScrollToCaret()
    what's wrong in here? i have a lot of text and it doesnt go to the end of the richtextbox..
    \m/\m/

  2. #2

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    bump
    \m/\m/

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The RichTextBox has to have focus to scroll (which seems kind of stupid). You can switch focus away from it after it scrolls though.
    VB Code:
    1. clientLogTxtBox.Focus()
    2.         clientLogTxtBox.Select(clientLogTxtBox.TextLength, 0)
    3.         clientLogTxtBox.ScrollToCaret()

  4. #4

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    yep tks, now it's working
    \m/\m/

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