I've done a GUI in VisualStudio and used a TextBox to show to user what's happening.
I use myTextBox.AppendText
to show information like
myTextBox.AppendText("\n" + DateTime.Now.ToLocalTime() + ": " + serviceName + " waiting for stopping");
service.Stop();
service.WaitForStatus(ServiceControllerStatus.Stopped);
service.Close();
myTextBox.AppendText("\n" + DateTime.Now.ToLocalTime() + ": " + serviceName + " has been stopped correcly");
and so on. The TextBox, anyway, is filled with the Text only when all jobs are completed. So, when all my code has finished to be run, the TextBox is filled with all the strings. So, I would like to print the string at the time I call AppendText
. Are I missing anything? Maybe is anything thread-freezing like in java?
Thank you in adavnce.