开发者

i am looking for an event that will fire just before the application is closed?

开发者 https://www.devze.com 2023-02-21 17:30 出处:网络
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 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

0

精彩评论

暂无评论...
验证码 换一张
取 消