private void saveToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Save(frm.DocName); frm.IsSaved = true; }
private void tbSave_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Save(frm.DocName); frm.IsSaved = true; }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = new blank(); //Создаём новый экземпляр формы frm frm.DocName = "Untitled" + ++openDocuments; frm.Text = frm.DocName; frm.MdiParent = this; //Указываем, что родительским контейнером нового экземпляра будет эта, глваная форма frm.Show(); //Вызываем форму }
private void colorToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.MdiParent = this; colorDialog1.Color = frm.richTextBox1.SelectionColor; if (colorDialog1.ShowDialog() == DialogResult.OK) { frm.richTextBox1.SelectionColor = colorDialog1.Color; } frm.Show(); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { blank frm = new blank(); frm.Open(openFileDialog1.FileName); frm.MdiParent = this; frm.DocName = openFileDialog1.FileName; frm.Text = frm.DocName; frm.Show(); } saveToolStripMenuItem.Enabled = true; }
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frm.Save(saveFileDialog1.FileName); frm.MdiParent = this; frm.DocName = saveFileDialog1.FileName; frm.Text = frm.DocName; } saveToolStripMenuItem.Enabled = true; frm.IsSaved = true; }
private void findToolStripMenuItem_Click(object sender, EventArgs e) { FindForm frm = new FindForm(); if (frm.ShowDialog(this) == DialogResult.Cancel) { return; } blank form = (blank)this.ActiveMdiChild; form.MdiParent = this; int start = form.richTextBox1.SelectionStart; form.richTextBox1.Find(frm.FindText, start, frm.FindCondition); }
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.SelectAll(); }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Delete(); }
private void copyToolStripMenuItem_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Copy(); }
private void tbPaste_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Paste(); }
private void tbCopy_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Copy(); }
private void toolStripButton1_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Copy(); }