Example #1
0
 private void dgvLegend_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if ((e.ColumnIndex == 0) & (e.RowIndex >= 0))
     {
         DataGridViewCell cell = this.dgvLegend[e.ColumnIndex, e.RowIndex];
         LegendSelectForm form = new LegendSelectForm((Color) cell.Value);
         form.ShowDialog();
         if (form.DialogResult == DialogResult.OK)
         {
             cell.Value = form.MainColor;
             this.btnApply.Enabled = true;
             this.m_Saved = false;
         }
     }
 }
Example #2
0
 private void dgvLegend_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if ((e.ColumnIndex == 0) & (e.RowIndex != -1))
     {
         LegendSelectForm form;
         if (e.RowIndex < this.m_Color.Count)
         {
             form = new LegendSelectForm(this.m_Color[e.RowIndex]);
         }
         else
         {
             form = new LegendSelectForm(this.m_Color[this.m_Color.Count - 1]);
         }
         form.ShowDialog();
         if (form.DialogResult == DialogResult.OK)
         {
             if (e.RowIndex < this.m_Color.Count)
             {
                 this.m_Color[e.RowIndex] = form.MainColor;
             }
             else
             {
                 this.m_Color.Add(form.MainColor);
             }
         }
         this.btnApply.Enabled = true;
         this.saved = false;
     }
 }