G
Guest
hi, im trying to create a 2D array of objects and ive done this before but i
must be forgetting something because i keep getting a null reference
exception at runtime....heres the code
Private arrTiles(7)() As Tile
Public Sub InitializeDisplay()
ReDim arrTiles(7)(7)
For i As Integer = 0 To 7
For j As Integer = 0 To 7
Dim tl As New Tile
tl.str = "red"
tl.Image = Image.FromFile("C:\Documents And
Settings\User\Desktop\Red.bmp")
''null reference error here!
arrTiles(i)(j) = tl
Next
Next
End Sub
any help would be great...
must be forgetting something because i keep getting a null reference
exception at runtime....heres the code
Private arrTiles(7)() As Tile
Public Sub InitializeDisplay()
ReDim arrTiles(7)(7)
For i As Integer = 0 To 7
For j As Integer = 0 To 7
Dim tl As New Tile
tl.str = "red"
tl.Image = Image.FromFile("C:\Documents And
Settings\User\Desktop\Red.bmp")
''null reference error here!
arrTiles(i)(j) = tl
Next
Next
End Sub
any help would be great...