I have pane with a number of panes on it. I need to access a pane using code and then to be able to change the labels within it.
Is this possible and if so could someone point me in the right direction... I did try GetAllviewsRecursive looking for panes but when running I get an error
For each v as node in p0.getallviewsrecursive
If v is pane then
Dim p as pane = v
For each c as node in p.getallviewsrecursive
If c is label then
log(c.text)
End if
Next
End if
Next
This code helps you if you are getting something unexpected while iterating
You only need one loop as getAllViewsRecursive will look inside all of the child panels.
B4X:
For Each v As Node In MainForm.RootPane.getallviewsrecursive ' of wherever you want to start
If V Is Label Then
Log(V.As(Label).Text)
Log(V.As(Label).Tag)
End If
Next
For each v as node in p0.getallviewsrecursive
If v is pane then
Dim p as pane = v
For each c as node in p.getallviewsrecursive
If c is label then
log(c.text)
End if
Next
End if
Next
This code helps you if you are getting something unexpected while iterating