in my codes
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pnl(6) As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
For i = 0 To 1
For j = 0 To 2
Left = (j * 120dip) + 10dip
Top = (i * 120dip) + 10dip
p = (i*3)+j
pnl(p).Initialize("")
pnl(p).Tag = Colors.RGB(Rnd(80, 256), Rnd(80, 256), Rnd(80, 256))
pnl(p).Color = pnl(p).Tag
Activity.AddView(pnl(p), Left, Top, 110dip, 110dip)
Next
Next
end sub
How to define An array of Panels click
like this
Sub pnl_Click
Dim pnl As Panel
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap( File.DirAssets ,"bback.png"))
pnl.Background =bd
End Sub
but the B4A undo
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pnl(6) As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
For i = 0 To 1
For j = 0 To 2
Left = (j * 120dip) + 10dip
Top = (i * 120dip) + 10dip
p = (i*3)+j
pnl(p).Initialize("")
pnl(p).Tag = Colors.RGB(Rnd(80, 256), Rnd(80, 256), Rnd(80, 256))
pnl(p).Color = pnl(p).Tag
Activity.AddView(pnl(p), Left, Top, 110dip, 110dip)
Next
Next
end sub
How to define An array of Panels click
like this
Sub pnl_Click
Dim pnl As Panel
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap( File.DirAssets ,"bback.png"))
pnl.Background =bd
End Sub
but the B4A undo