D' Eradicated
Member
- Joined
- Aug 25, 2014
- Messages
- 5
- Programming Experience
- 1-3
Hello.
I'm having a problem with an array of bitmaps not returning true even if it contains the BackgroundImage of the PictureBox. Here is my code:
I tried looping through the array and checking if it matches but it didn't work. Any advice? Thanks in advanced.
I'm having a problem with an array of bitmaps not returning true even if it contains the BackgroundImage of the PictureBox. Here is my code:
VB.NET:
Private Sub picGrid_Click(sender As Object, e As EventArgs) Handles pic77.Click, pic75.Click, pic73.Click, pic71.Click, pic66.Click, pic64.Click, pic62.Click, pic60.Click, pic57.Click, pic55.Click, pic53.Click, pic51.Click, pic46.Click, pic44.Click, pic42.Click, pic40.Click, pic37.Click, pic35.Click, pic33.Click, pic31.Click, pic26.Click, pic24.Click, pic22.Click, pic20.Click, pic17.Click, pic15.Click, pic13.Click, pic11.Click, pic06.Click, pic04.Click, pic02.Click, pic00.Click
Dim picTile As PictureBox = sender
Dim bmpBlueTiles() As Bitmap = {My.Resources.blue1, My.Resources.blue2, My.Resources.blue3, My.Resources.blue4, My.Resources.blue5, My.Resources.blue6, My.Resources.blue7, My.Resources.blue8, My.Resources.blue9, My.Resources.blue10, My.Resources.blue11, My.Resources.blue12}
Dim bmpRedTiles() As Bitmap = {My.Resources.red1, My.Resources.red2, My.Resources.red3, My.Resources.red4, My.Resources.red5, My.Resources.red6, My.Resources.red7, My.Resources.red8, My.Resources.red9, My.Resources.red10, My.Resources.red11, My.Resources.red12}
Dim X As Integer, Y As Integer
If strCurrentPlayer = "blue" Then
If bmpRedTiles.Contains(picTile.BackgroundImage) Then Exit Sub ' this line does not return to true, even if the array contains the picture
I tried looping through the array and checking if it matches but it didn't work. Any advice? Thanks in advanced.