i built a chat. it has a client winform and a server winform.
what i am need to do is to notify, the server when the client closed his application i.e. ClientA left the server.
I am looking for a way to fire an event that will be activated as soon as the client closed the winform.. so as soon as the winform closes, the event should be triggered, and i should put a code inside that will inform the server that the client has left.
The question 开发者_如何学Gois whether there is such an event?
You can use the Form.FormClosing
event. More details here.
The FormClosing event occurs as the form is being closed.
Use Form.FormClosed event or override method Form.OnFormClosed
精彩评论