Hi, there,
I have a MDI app written in C#. I have a form, then a
panel. The objects are drawn on the panel. When I closing
the window, I would like to save any changes that was
made. The code followed is in Form class:

public void ClosingHandler(Object sender, CancelEventArgs
e)
{
if(panel.Document.IsDirty ){
DialogResult save = MessageBox.Show("Do you want to
save changes ?","Name",
MessageBoxButtons.YesNoCancel);
...
}
}

But the message box would not show up unless I activate
another window then come back to my own.

Any idea what I am missing here?
Thanks in advance for your help.


Michael