autoscroll to bottom of multiline textbox being updated by backgroundworker

后端 未结 2 869
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 02:15

I have a background worker control that is set to perform a task, and update a multiline text box on my main UI using a delegate procedure. this is all working perfectly, howeve

相关标签:
2条回答
  • 2021-02-13 02:25

    Try it this way:

    'textbox.Text = text
    textbox.AppendText(text)
    

    The code you commented out wasn't running on the GUI thread, and as M Granja pointed out, AppendText will automatically scroll to the appended text in the box, so no need to call ScrollToCaret.

    0 讨论(0)
  • 2021-02-13 02:46

    xxx.SetFocus ' xxx = the name of the textbox

    SendKeys "^{END}" ' pop to last line

    0 讨论(0)
提交回复
热议问题