H
Hari
Hi,
my application contains an "Exit" menu item, when clicked should
exit from my application. Initially i used Application.Exit(). But that
was hanging the application and the application was not responding.
Even the form was not closing. Later i tried it with this.Close(). It
was closing the form. But still not exiting from the application. The
application contains a thread which runs in background to receive and
send messages on a socket. May be the thread was not stopped.
So i tried it in other way. I declared a static boolean variable in a
seperate class and looping in the thread until it is set to true. And
i'm setting the variable to true when the exit menuitem is selected and
then closing the form. Still it does'nt work. It closes the form but
does'nt return the control. What could be wrong. Any other solution? I
would be very thankful to any one who can help me.
my application contains an "Exit" menu item, when clicked should
exit from my application. Initially i used Application.Exit(). But that
was hanging the application and the application was not responding.
Even the form was not closing. Later i tried it with this.Close(). It
was closing the form. But still not exiting from the application. The
application contains a thread which runs in background to receive and
send messages on a socket. May be the thread was not stopped.
So i tried it in other way. I declared a static boolean variable in a
seperate class and looping in the thread until it is set to true. And
i'm setting the variable to true when the exit menuitem is selected and
then closing the form. Still it does'nt work. It closes the form but
does'nt return the control. What could be wrong. Any other solution? I
would be very thankful to any one who can help me.