private void BackColorSelect_Click(object sender, EventArgs e) { DialogColor.Color = BackColorPreview.ForeColor; if (DialogColor.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BackColorPreview.ForeColor = DialogColor.Color; } }
private void SelectColor(Control pb, ref XColor color) { var dColor = new DialogColor(pb.BackColor); if (dColor.ShowDialog() == DialogResult.OK) { pb.BackColor = dColor.Color; color = dColor.Color; } }
private void Form1_Load(object sender, EventArgs e) { DialogColor colorDialog = new DialogColor(Color.DarkBlue); colorDialog.ShowDialog(); comboBox1.Items.AddRange(Enum.GetNames(typeof(DrawStyle))); comboBox1.SelectedIndex = 0; colorPicker.ColorChanged += new ColorEventHandler(colorPicker_ColorChanged); }
private void SelectColor(Control pb, ref XmlColor color) { using (DialogColor dColor = new DialogColor(pb.BackColor)) { if (dColor.ShowDialog() == DialogResult.OK) { pb.BackColor = dColor.Color; color = dColor.Color; } } }
private void btnBrowseColor_Click(object sender, EventArgs e) { using (DialogColor colorPicker = new DialogColor()) { if (!string.IsNullOrEmpty(txtColor.Text)) { colorPicker.SetCurrentColor(MyColors.ParseColor(txtColor.Text)); } if (colorPicker.ShowDialog() == DialogResult.OK) { Color color = colorPicker.Color; txtColor.Text = string.Format("{0},{1},{2},{3}", color.A, color.R, color.G, color.B); } } }