mercredi 30 novembre 2016

If statements and picture box values issue

i'm trying to create a snap game but when it comes to checking if the picture box contains the correct image, it simply just does not work, i've done a bit of research regarding this and implemented the ideas. it does not throw up any sort of error but i just do not receive a increased value when i should. Please have a look at this code and tell me if you know where i'm going wrong.

Attempt 1:

  Dim BirdPics() As Image = {My.Resources.Image_1}
If tbxAnimal_Group.Text = "Birds" And BirdPics.Contains(pbxPicture.Image) Then

    CurrentPoints += 1
    lblScore.Text = "Score:" & CurrentPoints
End If

Attempt 2

     Dim BirdPics() As Image = {My.Resources.Image_1}
If tbxAnimal_Group.Text = "Birds" And pbxPicture Is BirdPics Then

    CurrentPoints += 1
    lblScore.Text = "Score:" & CurrentPoints
End If

Aucun commentaire:

Enregistrer un commentaire