private void fileToolStripMenuItem1_Click(object sender, EventArgs e) { var f = new Editor(); f.MdiParent = this; f.Show(); }
private void treeView1_DoubleClick(object sender, EventArgs e) { bool FoundMdiEditor = false; var sel = treeView1.SelectedNode.FullPath.Replace(Global.CurrentProjectFile.Name + "\\", ""); if (!sel.Contains(".")) { return; } foreach (var i in this.MdiParent.MdiChildren) { if (i is Editor) { if ((i as Editor).FileName == sel) { i.BringToFront(); FoundMdiEditor = true; } } } if (!FoundMdiEditor) { var f = new Editor(); f.FileName = sel; f.MdiParent = this.MdiParent; f.Show(); } }