private void mnuNew_Click(object sender, EventArgs e) { blank frm = new blank(); frm.DocName = "Unitled" + ++openDocuments; frm.Text = frm.DocName; frm.MdiParent = this; frm.Show(); }
private void mnuColor_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 cmnuSaveAs_Click(object sender, EventArgs e) { openFileDialog1.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { blank frm = (blank)this.ActiveMdiChild; frm.Save(saveFileDialog1.FileName); frm.MdiParent = this; frm.DocName = saveFileDialog1.FileName; frm.Text = frm.DocName; mnuSave.Enabled = true; frm.IsSaved = true; } }
private void mnuFont_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.MdiParent = this; fontDialog1.ShowColor = true; fontDialog1.Font = frm.richTextBox1.SelectionFont; fontDialog1.Color = frm.richTextBox1.SelectionColor; if (fontDialog1.ShowDialog() == DialogResult.OK) { frm.richTextBox1.SelectionFont = fontDialog1.Font; frm.richTextBox1.SelectionColor = fontDialog1.Color; } frm.Show(); }
private void mnuOpen_Click(object sender, EventArgs e) { openFileDialog1.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*"; 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(); mnuSave.Enabled = true; } }
private void mnuPaste_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Paste(); }
private void mnuCopy_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Copy(); }
private void mnuSelectAll_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.SelectAll(); }