So I'm trying to create a picture box at runtime, but my code just isn't working, no error or anything.
mouse.x,y store the last recorded mouse position
floor(mouse.x, mouse.y).type references the different images
If someone could help me out, it would be greatly appreciated.
Code:
Dim componentVisual(10, 10) As PictureBox 'Global Variable
Sub displayNewComponent()
Dim location As String = "F:\WindowsApplication1\WindowsApplication1\Resources\" + CStr(floor(mouse.x, mouse.y).type) + ".bmp"
componentVisual(mouse.x, mouse.y) = New PictureBox
componentVisual(mouse.x, mouse.y).Image = Image.FromFile(location)
componentVisual(mouse.x, mouse.y).Visible = True
componentVisual(mouse.x, mouse.y).Top = 12 + (mouse.x * 38)
componentVisual(mouse.x, mouse.y).Left = 10 + (mouse.y * 38)
componentVisual(mouse.x, mouse.y).Height = 31
componentVisual(mouse.x, mouse.y).Width = 31
Controls.Add(componentVisual(mouse.x, mouse.y))
End Subfloor(mouse.x, mouse.y).type references the different images
If someone could help me out, it would be greatly appreciated.