/// <summary> /// 窗体关闭前事件 /// </summary> /// <param name="sender">事件对象</param> /// <param name="e">事件参数</param> private void XBaseForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { try { if (m_IsModify) { MessageResult myResult = XMessageBox.Select("当前单据已修改,是否保存?", this); if (myResult == MessageResult.Yes) { SaveMethod(); } else if (myResult == MessageResult.Cancel) { e.Cancel = true; } } } catch (Exception ex) { XMessageBox.Exception(ex); } }