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); }
public ColorRowChangeEvent(ColorRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public void RemoveColorRow(ColorRow row) { this.Rows.Remove(row); }
public void AddColorRow(ColorRow row) { this.Rows.Add(row); }
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); } }