private void menuFile_New_Click(object sender, EventArgs e) { FormDocument frmDocument = new FormDocument(); frmDocument.Show(this.dockMain, DockState.Document); frmDocument.FormMain = this; }
private void menuFile_Open_Click(object sender, EventArgs e) { FormDocument activeDocument = this.ActiveMdiChild as FormDocument; if (activeDocument == null) { activeDocument = new FormDocument(); activeDocument.FormMain = this; activeDocument.Show(this.dockMain, DockState.Document); } OpenFileDialog openDlg = new OpenFileDialog(); openDlg.Filter = "Net.10|*.net.10|XML文件|*.xml|所有文件|*.*"; if (openDlg.ShowDialog() != DialogResult.OK) { return; } string fileName = openDlg.FileName; activeDocument.OpenDocument(fileName); }