Beispiel #1
0
        private void screenColorMenuItem_Click(object sender, EventArgs e)
        {
            using (var form = new ScreenColorPickerForm {
                ForeColor = this.ForeColor, BackColor = this.BackColor
            })
                try {
                    this.WindowState = FormWindowState.Minimized;

                    if (form.ShowDialog(this) == DialogResult.OK)
                    {
                        foreach (DataGridViewRow row in gridView.SelectedRows)
                        {
                            Color color    = GetRowColor(row.Index);
                            Color newColor = form.SelectedColor;
                            var   group    = GetRowColorGroup(row.Index);
                            SetRow(row.Index, group, newColor);
                            Renderer.ColorTable[group] = newColor;
                        }
                    }
                }
                finally {
                    this.WindowState = FormWindowState.Normal;
                    this.Activate();
                }
        }
Beispiel #2
0
    private void screenColorMenuItem_Click(object sender, EventArgs e)
    {
      using (var form = new ScreenColorPickerForm{ ForeColor = this.ForeColor, BackColor = this.BackColor })
      try {
        this.WindowState = FormWindowState.Minimized;

        if (form.ShowDialog(this) == DialogResult.OK)
        {
          foreach (DataGridViewRow row in gridView.SelectedRows)
          {
            Color color = GetRowColor(row.Index);
            Color newColor = form.SelectedColor;
            var group = GetRowColorGroup(row.Index);
            SetRow(row.Index, group, newColor);
            Renderer.ColorTable[group] = newColor;
          }
        }
      }
      finally { 
        this.WindowState = FormWindowState.Normal;
        this.Activate();
      }
    }