Reputation: 1341
After the gui works perfectly I am stunned how to integrate it into an endless program loop. The gui is meant to display the status of several socket-connections. So I have:
GenerateForm
How do I do that without the gui (GenerateForm
) called again and again?
do {
# write the status lines of the gui...
} until ( <# exit-function of the gui was called #> )
#disconnect, close and dispose..
Upvotes: 1
Views: 520
Reputation: 202032
The ShowDialog()
method blocks until the form is eventually closed. Therefore you need to do all your status updating as a result of events firing (inside an event handler). Since the Sockets class seems to be lacking in events, you can set up a WinForms timer event to fire an event handler every 500 millisecs or so to check the socket status.
Upvotes: 2