Hi Experts
VB.Net 4
I have a queue to which I am adding +- 5000 strings on a separate thread
To Speed things up, while these strings are being added, I am taking the strings from the queue and adding them to a textbox, fired from a timer on the main thread.
If I use -
If SelectedFilesQueue.Count <> 0 Then
TextBox1.AppendText(SelectedFilesQueue.Dequeue.ToString & vbCrLf)
End if
It works well but is VERY slow to complete
If I use -
While SelectedFilesQueue.Count <> 0
TextBox1.AppendText(SelectedFilesQueue.Dequeue.ToString & vbCrLf)
End While
This is fast, takes a quarter of the time, but it freezes my GUI.
If I try and add the second example to a separate thread, I still have the problem of updating the GUI from that thread
Anyone know how to keep the speed but stop the GUI from freezing?
Thanks in advance
Application.DoEvents()