if the data is saved/not saved, IsSafeToClose() returns true;
if the user clicks Cancel, IsSafeToClose() returns false;
protected override void OnClosing(System.ComponentModel.CancelEventArgs
ce)
{
ce.Cancel = (!this.IsSafeToClose());
base.OnClosing(ce);
}
I can't put the code whicch checks the data changes because the function
is called from another point in form, when the user closes the current
set of data/opens another one
the issue is that, ce.Cancel is set to true, but the form still unloads
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!