Hello everybody,
I currently have a problem and would be happy if anybody could help me out
I would like to write a generic function which finds out which page is currently active and then enables/disables buttons of the ToolBar (BarButtons) accordingly.
My problem now is:
1) How do I find out which page us currently active?
2) How would I access that Page dynamically? See <CURRENT_PAGE> in the example below...
NON WORKING example:
Even if I somehow (see question 1) knew the name of the page, the other problem (see question 2) unfortunately still remains
I would be very happy if you could help me out
Thanks a lot and best regards,
Christian
I currently have a problem and would be happy if anybody could help me out
I would like to write a generic function which finds out which page is currently active and then enables/disables buttons of the ToolBar (BarButtons) accordingly.
My problem now is:
1) How do I find out which page us currently active?
2) How would I access that Page dynamically? See <CURRENT_PAGE> in the example below...
NON WORKING example:
B4X:
Sub Generic_BarButtonDisableByTag (Tag As String)
Dim buttons As List = <CURRENT_PAGE>.ToolbarButtons
For i = 0 To buttons.Size - 1
Dim bb As BarButton = buttons.Get(i)
If bb.Tag = Tag Then
bb.Enabled = False
Exit
End If
Next
pageIn.ToolbarButtons = buttons
End Sub
Even if I somehow (see question 1) knew the name of the page, the other problem (see question 2) unfortunately still remains
I would be very happy if you could help me out
Thanks a lot and best regards,
Christian