private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) { Preferences p = new Preferences(this.colorDataGridView.DefaultCellStyle, this.colorDataGridView.ColumnHeadersDefaultCellStyle); }
//Preferences popup event handler private void preferencesToolStripMenuItem1_Click(object sender, EventArgs e) { Preferences p = new Preferences(this.NewBalanceDataGridView.DefaultCellStyle, this.NewBalanceDataGridView.ColumnHeadersDefaultCellStyle); DialogResult result = p.ShowDialog(); if(result != DialogResult.Abort) { // update balance colors var newCellStyle = this.NewBalanceDataGridView.DefaultCellStyle; newCellStyle.ForeColor = p.foreColor; newCellStyle.BackColor = p.backColor; var newColStyle = this.NewBalanceDataGridView.ColumnHeadersDefaultCellStyle; newColStyle.ForeColor = p.foreColor; newColStyle.BackColor = p.backColor; Settings.Default.foreColor = p.foreColor; Settings.Default.backColor = p.backColor; Settings.Default.Save(); } }