I am trying to create a number of picture boxes, each one called PicBox_'x-cood'_'y-cood'. Think of it as a kind of table of pic'boxes.
I want these pic'boxes to be called with the coordinates, using something like:
Assuming you could declare objects, in the same way you would concat' strings. Is there a way of doing this?
I have enclosed the rest of the code from the proc., if it might help you understand what i am trying to do?
Thanks.
I want these pic'boxes to be called with the coordinates, using something like:
Visual Basic:
Dim "PicBox_" & xpos & "_" & ypos As New PictureBox
Assuming you could declare objects, in the same way you would concat' strings. Is there a way of doing this?
I have enclosed the rest of the code from the proc., if it might help you understand what i am trying to do?
Visual Basic:
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Xpos As Short
Dim Ypos As Short
Dim MapSizeX As String
Dim MapSizeY As String
Dim aryMap(0, 0) As String
MapSizeX = InputBox("How many tiles do you wish to have for the width of the map?")
MapSizeY = InputBox("How many tiles do you wish to have for the height of the map?")
ReDim aryMap(MapSizeX, MapSizeY)
'MsgBox(MapSizeX & MapSizeY)
For Xpos = 1 To MapSizeX
For Ypos = 1 To MapSizeX
Dim "PicBox_" & xpos & "_" & ypos As New PictureBox
' .......rest of picbox stuff
Next Ypos
Next Xpos
End Sub
Thanks.