private void fontFamilyToolStripMenuItemChild_Clicked(object sender, EventArgs e) { // First, uncheckmark all previous font families uncheckmark_a_list(fontFamilyToolStripMenuItem); // Now checkmark the appropriate one ((ToolStripMenuItem)sender).Checked = true; ChildEditor form = (ChildEditor)this.ActiveMdiChild; string font_family = ((ToolStripMenuItem)sender).Text; if (form != null) { form.family = font_family; form.refresh_font(); } }
private void ptToolStripMenuItem_Click(object sender, EventArgs e) { // First, uncheckmark all previous pt's uncheckmark_a_list(fontSize); ChildEditor form = (ChildEditor)this.ActiveMdiChild; ToolStripMenuItem li = (ToolStripMenuItem)sender; li.Checked = true; string name = li.Name; // The name of all the font size toolstrip menu items starts with pt and then followed // by the integer of the font size. Hence, we need to strip the first two characters off // and convert the result to a float. float font_size = Convert.ToInt64(name.Substring(2)); if (form != null) { form.size = font_size; form.refresh_font(); } }