Battle_Script_Pro.Form1.backgroundColourToolStripMenuItem_Click C# (CSharp) Method

backgroundColourToolStripMenuItem_Click() private method

private backgroundColourToolStripMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void backgroundColourToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorDialog d = new ColorDialog();
            DialogResult result = d.ShowDialog();
            if (result == DialogResult.OK)
            {
                rtbBackColour = d.Color;
                foreach (FixedRichTextBox rtb in scripts)
                {
                    rtb.BackColor = d.Color;
                    rtbNotes.BackColor = d.Color;
                }
                string[] ini = File.ReadAllLines(System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini");
                List<string> newIni = new List<string>();
                foreach (string s in ini)
                {
                    if (s.StartsWith("backcolour"))
                    {
                        string[] line = s.Split('=');
                        line[1] = d.Color.ToString().Substring(7).Substring(0, d.Color.ToString().Substring(7).Length - 1);
                        newIni.Add(line[0] + "=" + line[1]);
                    }
                    else
                    {
                        newIni.Add(s);
                    }
                }
                File.WriteAllLines(System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini", newIni.ToArray());
            }
        }
Form1