>To make sure that the user dosn't leave the form without saving or reverting changes, you'll need to put the GETFLDSTATE code in the QueryUnload method, or in a method that gets called from QueryUnload. Then have the release method call the run the QueryUnload method.
>
>(Clicking the X button in the corner of the form does not run the release method, and running THISFORM.Release does not call the QueryUnload method, so this is a way to have the same code run no matter how the user attempts to leave the form).
I'd just like to make this point: Closing the form by the ways which run QueryUnload don't run Release, as you say. But unloading the form does run the Unload event no matter how you get there.
I put things in QueryUnload which are specific to the user closing the form by the ways that call QueryUnload. I put things in form.Unload which need to be run "no matter how the user [leaves the form]."
Just a suggestion.
Cheers,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing