protected override void OnMouseClick(MouseEventArgs e) { var colorPickerForm = new ColorPickerForm(); colorPickerForm.Color = Color; colorPickerForm.ColorChanged += (sender, args) => { Color = ((ColorPickerForm)sender).Color; OnColorChanged(this, args); }; colorPickerForm.ShowDialog(); }
protected override void OnMouseClick(MouseEventArgs e) { var formStartPosition = FormStartPosition.CenterParent; var parentForm = FindFormInternal(); if (parentForm == null) { formStartPosition = FormStartPosition.WindowsDefaultLocation; } var colorPickerForm = new ColorPickerForm(); colorPickerForm.Color = Color; colorPickerForm.StartPosition = formStartPosition; colorPickerForm.ColorChanged += (sender, args) => { Color = ((ColorPickerForm)sender).Color; OnColorChanged(this, args); }; colorPickerForm.ShowDialog(parentForm); }