Sub CheckerboardFade(ivBackground As Int) ' want ti add ivPanel as parameter but need to get the basics down first
Dim ivTop As Int = ivPanel.Top
Dim ivLeft As Int = ivPanel.Left
Dim ivWidth As Int = ivPanel.Width
Dim ivHeight As Int = ivPanel.Height
Dim lBox(1000) As Label ' Why 1000? If I use Dim lbox() as Label I get index out of range error below
' Randomize all this after it actually draws a box
Dim i,x,y As Int
i = 0
For x = 0 To ivWidth Step 10
For y = 0 To ivHeight Step 10
i = i + 1
lBox(i).Initialize("")
lBox(i).Color = ivBackground
lBox(i).Width = 10dip
lBox(i).Height = 10dip
lBox(i).Text = "!" ' This is for testing. Background of label should be enough to draw box
ivPanel.AddView(lBox(i),ivLeft+(x * 10),ivTop + (y * 10),lBox(i).Width,lBox(i).Height)
lBox(i).BringToFront
Log( i & " " & x & " " & y)
Next
Next
End Sub