I have 5 background images for my application that will be visible to the user's taste. What is the simplest (clean code) way to make the user choose?
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Visible = true;
pictureBox2.Visible = false;
pictureBox3.Visible = false;
pictureBox4.Visible = false;
pictureBox5.Visible = false;
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
pictureBox2.Visible = true;
pictureBox1.Visible = false;
pictureBox3.Visible = false;
pictureBox4.Visible = false;
pictureBox5.Visible = false;
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Visible = false;
pictureBox2.Visible = false;
pictureBox3.Visible = true;
pictureBox4.Visible = false;
pictureBox5.Visible = false;
}
private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Visible = false;
pictureBox2.Visible = false;
pictureBox3.Visible = false;
pictureBox4.Visible = true;
pictureBox5.Visible = false;
}
private void img5_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Visible = false;
pictureBox2.Visible = false;
pictureBox3.Visible = false;
pictureBox4.Visible = false;
pictureBox5.Visible = true;
}