-1
Hello, I wonder if it is possible to use a Click event inside an IF. I will try to explain my situation. At the moment I have this:
foreach (Label lblCor in panel1.Controls)
if (lblNum.Text == lblCor.Text)
{
lblCor.Click += new EventHandler(lblCor_Click);
lblCor.BackColor = Color.Orange;
}
private void lblCor_Click(object sender, EventArgs e)
{
}
I am trying to make it so that when lblNum.text equals lblCor.Text, and click lblCor, it will change color. It will be possible to do this?
Thank you
The problem is that I have different panels and each of these panels has 27 Labels. And this way I can’t use this for all Labels
– D. Rodrigues
If you have different panels you have to foreach (which adds the event) to each one of them... or find another way to create the event for all the Slides...or even manually via you_form.designer.Cs
– vik