Android Question Disable Click event on a label

Luki

New Member
Licensed User
Longtime User
Hi all,

I am learning b4a now and have a question. I have tried to do a search on this website but did not find the answer.

How can i disable the click event to a label? I have the sub of click event:
B4X:
Sub lblWoord_Click
    Dim Lbl As Label
    Lbl = Sender
    If Lbl.TextColor = Colors.Black Then
        Lbl.TextColor = Colors.White
        Lbl.Color = Colors.Blue
    Else If Lbl.TextColor = Colors.White Then
        Lbl.TextColor = Colors.Black
        Lbl.Color = Colors.Transparent
    End If
End Sub

At some point i want to deactivate a label such that if it is clicked the event will not be invoked. How can i do this?

Many thanks!
 

derez

Expert
Licensed User
Longtime User
At the "some point" put a tag on the labels that you want to disable.
Then at the click event check:
B4X:
Sub lblWoord_Click
Dim Lbl As Label
Lbl = Sender
If lbl.tag <> ["some point"] then
      '...do things
End If
End Sub
 
Upvote 0
Top