private void textBox1_Enter(object sender, EventArgs e) { if (colorDialog1.ShowDialog() == DialogResult.OK) { textBox1.BackColor = colorDialog1.Color; } }