protected void ChangeColor(ColorRow row, int index)
        {
            Color?c = row[index];

            if (!c.HasValue)
            {
                return;
            }
            Color currentColor = c.Value;

            // Set the initial color select to the current color
            _colorDialog.Color = System.Drawing.Color.FromArgb(currentColor.A, currentColor.R, currentColor.G, currentColor.B);


            // Update the text box color if the user clicks OK
            if (_colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                System.Drawing.Color newColor = _colorDialog.Color;
                row[index] = Color.FromArgb(newColor.A, newColor.R, newColor.G, newColor.B);
            }
        }
        private void Color0Click(object sender, RoutedEventArgs e)
        {
            ColorRow row = (ColorRow)((Button)sender).DataContext;

            ChangeColor(row, 0);
        }
示例#3
0
 public ColorRowChangeEvent(ColorRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
示例#4
0
 public void RemoveColorRow(ColorRow row) {
     this.Rows.Remove(row);
 }
示例#5
0
 public void AddColorRow(ColorRow row) {
     this.Rows.Add(row);
 }
示例#6
0
    protected void ChangeColor(ColorRow row, int index)
    {
      Color? c = row[index];
      if (!c.HasValue)
        return;
      Color currentColor = c.Value;
      // Set the initial color select to the current color
      _colorDialog.Color = System.Drawing.Color.FromArgb(currentColor.A, currentColor.R, currentColor.G, currentColor.B);


      // Update the text box color if the user clicks OK 
      if (_colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
      {
        System.Drawing.Color newColor = _colorDialog.Color;
        row[index] = Color.FromArgb(newColor.A, newColor.R, newColor.G, newColor.B);
      }
    }