private void Form_Closing(object sender, CancelEventArgs e)
{
if (!e.Cancel)
{
// MDI child forms do not support transparency so do not try to use the Fade method.
if (_form.MdiParent == null || _method != AnimationMethod.Fade)
{
NativeMethods.AnimateWindow(_form.Handle, _duration, AwHide | (int)_method | (int)_direction);
}
}
}