Question Stopping form closing

Codeman_cas

New member
Joined
May 29, 2011
Messages
4
Programming Experience
1-3
Hi people,

I wonder if anyone can help, im writing a program for work that monitors our PCs and our software and sends picked up errors to an android app.

I've got both working fine (Vb and android) but when i go to a machine sometimes the program is closed with no errors, ive removed the control box and hidden the close option (in a hidden label).

My question is, is there a way to keep the form alive constantly, ive scheduled a task schedule to run the app if its dead, nightly, but it doesn't seem to help.

Ive installed it on around 20 pcs and it only seems to close on about 8 of them.

Cheers
Mark
 
I would think that the first order of business would be to determine why it's closing in the first place. Applications don't just close randomly of their own accord. Obviously something is going on so just preventing a form closing isn't going to address the root cause.

Anyway, you can handle the FormClosing event and cancel it to prevent a form closing. Make sure that you check the close reason because otherwise the form will never close and prevent you rebooting.
 
Back
Top