/// <summary> /// Create a document /// </summary> /// <param name="main"></param> /// <param name="name"></param> /// <returns></returns> public static FormDocument CreateDocument(this FormMain main, string name) { FormDocument newDoc = new FormDocument(); string title = name; if (File.Exists(title)) { title = Path.GetFileName(title); } newDoc.Text = title; newDoc.TabText = name; newDoc.BaseTabText = name; _Documents.Add(newDoc); newDoc.Show(main.DockingPanel); return(newDoc); }
/// <summary> /// Создание нового документа. /// </summary> private void НовыйДокументToolStripMenuItem_Click(object sender, EventArgs e) { FormDocument formDocument = new FormDocument(); formDocument.Show(); }