private void AppCommandNew_Executed(object sender, EventArgs e) { // Close Application Menu buttonFile.Expanded = false; frmDocument doc = new frmDocument(); doc.Text = "New Document " + (this.MdiChildren.Length + 1); doc.MdiParent = this; doc.WindowState = FormWindowState.Maximized; doc.Show(); doc.Update(); }
private void AppCommandOpen_Executed(object sender, EventArgs e) { // Close Application Menu buttonFile.Expanded = false; openFileDialog1.FileName = ""; openFileDialog1.ShowDialog(); if (openFileDialog1.FileName == "") return; frmDocument doc = new frmDocument(); doc.Text = openFileDialog1.FileName; doc.MdiParent = this; doc.Show(); doc.OpenFile(openFileDialog1.FileName); }
internal void SaveDocument(frmDocument doc) { if(doc.FileName=="") { if(saveFileDialog1.ShowDialog()!=DialogResult.OK) return; if(saveFileDialog1.FileName=="") return; doc.FileName=saveFileDialog1.FileName; } if(doc.FileName!="") doc.SaveFile(); }