devxlogo

Append a string to a textbox quickly and without flickering

Append a string to a textbox quickly and without flickering

The usual way to append text to a TextBox or a RichTextBox control is to concatenate the current contents with the new string:

Text1.Text = Text1.Text & newString

Here is a different approach, which is slightly faster and causes less flickering:

Text1.SelStart = Len(Text1.Text)Text1.SelText = newString 

devx-admin

Share the Post: