private void button1_Click(object sender, EventArgs e) { var colorChooser = new ColorChooser(); colorChooser.Color = (bsParameter.Current as ShaderParam).Color; if (colorChooser.ShowDialog() == System.Windows.Forms.DialogResult.OK) { (bsParameter.Current as ShaderParam).Color = colorChooser.Color; } }
private void Button_MouseClick(Control sender, MouseEventArgs args) { var colorChooser = new ColorChooser(); colorChooser.Color = Color; if (colorChooser.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Color = colorChooser.Color; if (ColorChanged != null) ColorChanged(this, new EventArgs()); } }