protected override void OnHandleDestroyed(EventArgs e)
 {
     base.OnHandleDestroyed(e);
     if (_currentForm == this)
     {
         _currentForm = null;
     }
 }
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            if (_currentForm != null && _currentForm.IsHandleCreated)
            {
                _currentForm.Close();
            }
            _currentForm = this;
        }