예제 #1
0
        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();
        }
예제 #2
0
        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);
        }
예제 #3
0
 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();
 }