protected override void OnClick(EventArgs e) { Point p = PointToScreen(new Point(0, this.Height)); ColorPaletteDialog clDlg = new ColorPaletteDialog(p.X, p.Y); clDlg.ShowDialog(FindForm()); if(clDlg.DialogResult == DialogResult.OK) { _selectedColor = clDlg.Color; if(this.ColorChanged != null) this.ColorChanged(this, clDlg.Color); } Invalidate(); clDlg.Dispose(); }
protected override void OnClick(EventArgs e) { Point p = PointToScreen(new Point(0, this.Height)); ColorPaletteDialog clDlg = new ColorPaletteDialog(p.X, p.Y); clDlg.ShowDialog(FindForm()); if (clDlg.DialogResult == DialogResult.OK) { _selectedColor = clDlg.Color; if (this.ColorChanged != null) { this.ColorChanged(this, clDlg.Color); } } Invalidate(); clDlg.Dispose(); }