public void ShowColorDialog() { using (ColorPickerForm dialogColor = new ColorPickerForm(Color)) { if (dialogColor.ShowDialog() == DialogResult.OK) { Color = dialogColor.NewColor; } } }
private void btnColorDialog_Click(object sender, EventArgs e) { using (ColorPickerForm dialogColor = new ColorPickerForm(Color.FromArgb(tbRed.Value, tbGreen.Value, tbBlue.Value))) { if (dialogColor.ShowDialog() == DialogResult.OK) { Color color = dialogColor.NewColor; tbRed.Value = color.R; tbGreen.Value = color.G; tbBlue.Value = color.B; DrawRedGreenBlue(); } } }
public static Color GetColor(Color currentColor) { using (ColorPickerForm dialog = new ColorPickerForm(currentColor)) { dialog.rbSaturation.Checked = true; if (dialog.ShowDialog() == DialogResult.OK) { return(dialog.NewColor); } } return(currentColor); }