tags:

views:

147

answers:

1

Hi:

I am working on a c# project that has a mdi parent form hosting multiple mdi children form. In one of the children forms, I opened a socket and listening on the socket using tcpListner. I stop the tcpListner when user close that mdi childform. But when I close the mdi parent without close the mdi children form first, the tcpListner did not get stopped.

My question is: Do I have to manually call each mdi children's form_close event handler when I close Mdi-parent form? How to make sure a specific socket is closed or tcpListner is stopped?

Thanks

A: 

Perhaps you might try putting it into the form_closing event? It fires before the form_close event.

Scott