//creates a workshop form with the name given private void okButton_Click(object sender, EventArgs e) { Workshop newFile = new Workshop(nameBox.Text); newFile.MdiParent = this.MdiParent; newFile.Show(); this.Close(); }
//opens the dialog and once chosen gives the result //and file name to a newly created workshop form private void openMenu_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = "Supply Files|*.sup"; open.Title = "Choose a Workshops File"; if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DialogResult result = open.ShowDialog(); if (result != DialogResult.Cancel) { Workshop openFile = new Workshop(result, open.FileName); openFile.MdiParent = this; openFile.Show(); } } }