Exemplo n.º 1
0
 private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Preferences p = new Preferences(this.colorDataGridView.DefaultCellStyle, this.colorDataGridView.ColumnHeadersDefaultCellStyle);
 }
Exemplo n.º 2
0
        //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();
            }
        }