I am trying to use a simple IF statement to check if text is present AND if a pictures is also present. But it will not recognise the picture.
I am checking if the picture is present in an array of buttons.
I can not get the message box to appear.
I have deleted the part that say " && buttonArray[i].Image == WindowsFormsApp1.Properties.Resources.flag "
and that part of the code runs.
for (int i = 0; i < 81; i++)
{
if (buttonArray[i].Text == "B" && buttonArray[i].Image == WindowsFormsApp1.Properties.Resources.flag)
{
MessageBox.Show("You Win!");
}
}
Aucun commentaire:
Enregistrer un commentaire