i want to add all panels inside a panel and do something with them the problem if i call the panel i get allways the last added panel to the array and not the right panel
i do it like this
the location of every panel is correct only if i want to change the panel visible to false it change always the last panel in the array and not the panel i choose but all other data is correct!!
i do it like this
B4X:
Sub Globals
Type blocks(pnl As Panel, left As Int, right As Int, top As Int,bottom As Int,action As String)
Dim bl(100) As blocks 'max panels
End Sub
'....
Sub addpanelstoarray
Dim i As Int = 0
blsize = 0
For Each p As Panel In pnl1.GetAllViewsRecursive
bl(i).pnl = p
bl(i).left = p.Left
bl(i).right = p.Left + p.Width
bl(i).top = p.Top
bl(i).bottom = p.Top + p.Height
bl(i).action = p.Tag
i = i+1
Next
blsize = i
End Sub
sub btn1_click
bl(0).pnl.SetVisibleAnimated(400,False)
end sub
the location of every panel is correct only if i want to change the panel visible to false it change always the last panel in the array and not the panel i choose but all other data is correct!!