//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(); } } }
//called with the workshop its adding to and its name public InsertForm(Workshop current, string name) { InitializeComponent(); insertTarget = current; title.Text += " " + name; }