Why don't you simply use the FormClosing event for this?