When working with console applications, Console.Readline relinquishes processing to the UI from the Main thread and only continues when an event, such as the pressing of the enter button is fired. How do I replicate this functionality (With a Window form as the UI in this case) in windows form application?
+1
A:
Use form.ShowDialog() instead of form.Show()
This will not stop the thread, but it will stop the user from doing other things in the UI until the window is closed.
Danny Varod
2010-02-19 18:39:31
A:
Maybe I did not explain this right. What I would like to do is create a service, listen for connections, once a connection is obtained, I display this information on the windows form and then wait for user to put together a response before sending the response back to the client using the same connection.
Kobojunkie
2010-02-20 17:18:15
A:
Now that you have explained what you want to do...
It would be better to use a BackgroundWorker, keep the GUI active, but disabled and presenting a progress bar + cancel button, until done.
Danny Varod
2010-02-26 19:10:56