Color Combobox

  • Thread starter Thread starter Anina
  • Start date Start date
A

Anina

When setting a color property of a control (like the BackColor) in the
property window of C#, you get a popup containing three tabs labeled Custom,
Web and System, which is used to select the color.

Is there a way that I can use this same feature on a control that I display
the user of the application?

Is that dropdown available for me to use?

Anina
 
Add a ColorDialog component to your form and display it from an event (e.g.
a button click). Then you can grab the color that the user selected and set
whatever control you wish to use that color.

<snip>
private void button1_Click(object sender, System.EventArgs e)
{
if ( colorDialog1.ShowDialog() == DialogResult.OK )
{
textBox1.BackColor = colorDialog1.Color;
}
}
</snip>

Is that what you were looking for?
 
Back
Top