I am trying to avoid keeping an array to record the existence of transparent Labels which overlay Rects, to give the Rects a Click.
In the common Click Sub I use Sender to return the Label.
Outside the Click Sub I later need to bring the label to the front of the underlying Rect which was by now redrawn, probably on top of the Label.
I thought that if I saved the Sender Label in the main Panel.Tag before leaving the Click sub, I could retrieve it later and BringToFront.
It did not work.
This is the only reference needed to the Labels outside the Click sub.
Is there any other way please?
In the common Click Sub I use Sender to return the Label.
Outside the Click Sub I later need to bring the label to the front of the underlying Rect which was by now redrawn, probably on top of the Label.
I thought that if I saved the Sender Label in the main Panel.Tag before leaving the Click sub, I could retrieve it later and BringToFront.
It did not work.
This is the only reference needed to the Labels outside the Click sub.
Is there any other way please?
B4X:
Dim lb as Label
Sub A_Click
Dim snd as Label
snd=Sender
...
pnl.Tag=snd
End Sub
'Problem... cannot get a click after underlying Rect redrawn.
'This did not work but did allow colour change but no click 'Probably because it is now a different Label??
lb.Initialize("A") 'Am I putting a new label over the old?
lb=pnl.Tag
lb.Color= Colors.LightGray
lb.BringToFront
Last edited: