private void button1_Click(object sender, EventArgs e) { FontDialog fd = new FontDialog(); fd.Font = GlobalTemplates.GetTemplateFont((string)listBox1.SelectedItem); if (fd.ShowDialog(this) != DialogResult.None) { GlobalTemplates.ChangeTemplate((string)listBox1.SelectedItem, GlobalTemplates.GetTemplateForeColor((string)listBox1.SelectedItem), fd.Font); } listBox1_SelectedIndexChanged(new object(), new EventArgs()); }
private void button2_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.Color = GlobalTemplates.GetTemplateForeColor((string)listBox1.SelectedItem); if (cd.ShowDialog(this) != DialogResult.None) { GlobalTemplates.ChangeTemplate((string)listBox1.SelectedItem, cd.Color, GlobalTemplates.GetTemplateFont((string)listBox1.SelectedItem)); } listBox1_SelectedIndexChanged(new object(), new EventArgs()); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox1.Font = GlobalTemplates.GetTemplateFont((string)listBox1.SelectedItem); textBox1.ForeColor = GlobalTemplates.GetTemplateForeColor((string)listBox1.SelectedItem); button2.Enabled = button1.Enabled = true; }