示例#1
0
        private void GridForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (IsGridChanged)
            {
                DialogResult closeSaveResult = MessageBox.Show("Do you want to save last changes?",
                                                               "Save File", MessageBoxButtons.YesNoCancel);

                if (closeSaveResult == DialogResult.Cancel)
                {
                    e.Cancel = true;
                }
                else if (closeSaveResult == DialogResult.Yes)
                {
                    FilesHandler.SaveFile(this);
                }
            }
        }
示例#2
0
 private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FilesHandler.SaveFile(this);
 }
示例#3
0
 private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FilesHandler.OpenFile(this);
 }