private void ShowNewForm(object sender, EventArgs e) { Form childForm = new ThemeForm(); childForm.MdiParent = this; childForm.Show(); }
private void OpenFile(object sender, EventArgs e) { const string openpath = @"C:\WorkingCopy\ThemeFileEditor\Themes"; OpenFileDialog openFileDialog = new OpenFileDialog(); if (File.Exists(openpath)) { openFileDialog.InitialDirectory = openpath; } else if (File.Exists(ActiveThemeForm?.FileName)) { openFileDialog.InitialDirectory = Path.GetDirectoryName(ActiveThemeForm.FileName); } else { openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Resources); } openFileDialog.Filter = "Theme Files (*.theme)|*.theme|All Files (*.*)|*.*"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string FileName = openFileDialog.FileName; Form childForm = new ThemeForm(FileName); childForm.MdiParent = this; childForm.Show(); } }
private void ThemeEditor_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string file in files) { Form childForm = new ThemeForm(file); childForm.MdiParent = this; childForm.Show(); } }