Tony2005
01-09-2004, 11:24 AM
im trying to load a control array, in a loop. the control is a picBox in a frame. this is my code so far
-------------------------------------------------------------------------
Public Sub Grid()
Dim CounterY, CounterX, Height, Width, CellRef As Integer
Height = Val(txtHeight.Text)
Width = Val(txtWidth.Text)
For CounterX = 1 To Width
For CounterY = 1 To Height
CellRef = CounterY * CounterX
Load picCell(CellRef)
picCell(CellRef).Top = CounterY * 150
picCell(CellRef).Left = CounterX * 150
picCell(CellRef).Visible = True
Next CounterY
Next CounterX
End Sub
-------------------------------------------------------------------------
CounterY and X are default at 10
when i run the program it says the object is loaded even tho picCell(0) is the only control loaded.
any ideas on how to sort this?
-------------------------------------------------------------------------
Public Sub Grid()
Dim CounterY, CounterX, Height, Width, CellRef As Integer
Height = Val(txtHeight.Text)
Width = Val(txtWidth.Text)
For CounterX = 1 To Width
For CounterY = 1 To Height
CellRef = CounterY * CounterX
Load picCell(CellRef)
picCell(CellRef).Top = CounterY * 150
picCell(CellRef).Left = CounterX * 150
picCell(CellRef).Visible = True
Next CounterY
Next CounterX
End Sub
-------------------------------------------------------------------------
CounterY and X are default at 10
when i run the program it says the object is loaded even tho picCell(0) is the only control loaded.
any ideas on how to sort this?