In my program, I append text to a textbox and my program proceeds onward before the textbox finishes rendering. This is bad karma to the user.
To demonstrate this issue, I have written to the System.Console
and I see many text lines displayed in the MS Visual C# Express console tab before the text is displayed in the control (in my application).
I have tried Textbox.Update()
with no luck, program keeps executing. Textbox.Refresh()
does not help either.
How do I get a thread (the GUI or another thread) to wait until the Textbox has finished rendering?
I want to perform the following (in psuedo code):
Textbox.AppendText("New text\r\n");
// Execution blocked until Textbox finishes drawing.
Textbox.WaitForRenderingToFinish();