private void button1_Click(object sender, EventArgs e) { ColorDialog dlg = new ColorDialog(); if (dlg.ShowDialog() == DialogResult.OK) { if (!listBox1.Items.Contains(textBox1.Text)) { PlotterFunctions.colours.Add(textBox1.Text, dlg.Color); loadList(); PlotterFunctions.saver(configFileName); PlotterFunctions.loader(configFileName); PlotterFunctions.reloadColours(); } else { PlotterFunctions.colours.Remove(textBox1.Text); PlotterFunctions.colours.Add(textBox1.Text, dlg.Color); loadList(); PlotterFunctions.saver(configFileName); PlotterFunctions.loader(configFileName); PlotterFunctions.reloadColours(); } } }
private void button2_Click(object sender, EventArgs e) { PlotterFunctions.colours.Remove(listBox1.SelectedItem.ToString()); loadList(); PlotterFunctions.saver(configFileName); PlotterFunctions.loader(configFileName); PlotterFunctions.reloadColours(); }
private void form1_Load(object sender, EventArgs e) { PlotterFunctions.loader(ConfigFileName); setNumerics(); PlotterFunctions.reloadColours(); PlotterFunctions.handshake(); label4.Text = PlotterFunctions.plotterName; if (label4.Text.Equals("Plotter Not Connected")) { label4.ForeColor = Color.FromArgb(255, 0, 0); } else { label4.ForeColor = Color.FromArgb(0, 128, 32); } }