private void openFile_Click(object sender, EventArgs e) { try { OpenFileDialog oD = new OpenFileDialog(); if (oD.ShowDialog() == DialogResult.OK) { Editor mdiChild = new Editor(); mdiChild.MdiParent = this; mdiChild.DrawingObjects = WorkWithFile.ReadFromFile(oD.FileName); mdiChild.ChangeTitle(oD.FileName); mdiChild.Show(); } } catch (Exception exp) { MessageBox.Show("File can't open! " + exp.Message); } }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { Editor mdiChild = new Editor(); mdiChild.MdiParent = this; mdiChild.Show(); }