private void colorToolStripMenuItem_Click(object sender, EventArgs e) { file_form ff = (file_form)this.ActiveMdiChild; ff.MdiParent = this; colorDialog1.Color = ff.getRichTextBox().SelectionColor; if (colorDialog1.ShowDialog() == DialogResult.OK) { ff.getRichTextBox().SelectionColor = colorDialog1.Color; } ff.Show(); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { file_form new_ff = new file_form(); new_ff.MdiParent = this; new_ff.setFormName("Untitled " + window_id); new_ff.Show(); window_id++; ToolStripMenuItem tsmi = new ToolStripMenuItem(new_ff.getFormName(), null, new EventHandler(menuClick)); arrangeIconsToolStripMenuItem.DropDownItems.Add(tsmi); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.FileName = "Текстовые файлы"; openFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files(*.*)|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { file_form ff = new file_form(); ff.Open(openFileDialog1.FileName); ff.MdiParent = this; ff.setFormName(openFileDialog1.FileName); ff.Text = ff.getFormName(); ff.Show(); saveAsToolStripMenuItem.Enabled = true; saveToolStripMenuItem.Enabled = true; ToolStripMenuItem tsmi = new ToolStripMenuItem(ff.getFormName(), null, new EventHandler(menuClick)); arrangeIconsToolStripMenuItem.DropDownItems.Add(tsmi); } }
private void fontToolStripMenuItem_Click(object sender, EventArgs e) { file_form ff = (file_form)this.ActiveMdiChild; ff.MdiParent = this; fontDialog1.ShowColor = true; fontDialog1.Font = ff.getRichTextBox().SelectionFont; fontDialog1.Color = ff.getRichTextBox().SelectionColor; if (fontDialog1.ShowDialog() == DialogResult.OK) { ff.getRichTextBox().SelectionFont = fontDialog1.Font; ff.getRichTextBox().SelectionColor = fontDialog1.Color; } /*fontDialog1.Font = ff.richTextBox1.SelectionFont; * fontDialog1.Color = ff.richTextBox1.SelectionColor; * if (fontDialog1.ShowDialog() == DialogResult.OK) * { * ff.richTextBox1.SelectionFont = fontDialog1.Font; * ff.richTextBox1.SelectionColor = fontDialog1.Color; * }*/ ff.Show(); }