public void Save(object sender, System.EventArgs e) { blank frm = (blank)this.ActiveMdiChild; saveFileDialog1.ShowDialog(); frm.Save(saveFileDialog1.FileName); }
private void mnuNew_Click(object sender, EventArgs e) { blank frm = new blank(); frm.DocName = "Untitled " + ++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 Frmmain_FormClosing(object sender, FormClosingEventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Close(); if (frm.IsSaved == true) { if (MessageBox.Show(resourceManager.GetString("MessageText"), "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Save(frm.DocName, e); } } }
public void cmnuSaveAs_Click(object sender, EventArgs e) { 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; cmnuSaveAs.Enabled = true; frm.IsSaved = true; } }
private void mnuOpen_Click(object sender, EventArgs e) { cmnuSaveAs.Enabled = true; 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(); } }
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 mnuDelete_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Delete(); }
private void mnuCopy_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.Copy(); }
private void mnuSave_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; this.Save(frm.DocName, e); }
private void mnuSelectAll_Click(object sender, EventArgs e) { blank frm = (blank)this.ActiveMdiChild; frm.SelectAll(); }