Stopping TextBox flicker during update

前端 未结 6 1177
情书的邮戳
情书的邮戳 2020-12-20 12:26

My WinForms application has a TextBox that I\'m using as a log file. I\'m appending text without the form flickering using TextBox.AppendText(string);, however

6条回答
  •  甜味超标
    2020-12-20 12:40

    Did you try SuspendLayout() / ResumeLayout() around all your update operations?

    You could also call Clear() on the textbox then reassign the truncated text.

    If your try to implement some kind of log file viewer, you could use a ListBox instead.

提交回复
热议问题