Exemplo n.º 1
0
        /// <summary>
        /// Form is closng
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!docManager.CloseDocument())
            {
                e.Cancel = true;
            }

            SaveSettingsToRegistry();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Form is closing
        /// </summary>
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                if (!docManager.CloseDocument())
                {
                    e.Cancel = true;
                }
            }

            SaveSettingsToRegistry();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Form is closing  MDI窗体已取消
 /// </summary>
 private void DrawForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         if (!docManager.CloseDocument())
         {
             e.Cancel = true;
             return;
         }
     }
     //解决MDI关闭子窗体时发生“无法访问已释放对象”的.net框架问题
     this.Hide();
     this.Parent = null;
     SaveSettingsToRegistry();
 }