I want to disable a label as soon as it is clicked however the code hides the label.
What I want is to disable it (make darkgrey and unclickable), not make it disappear.
Label3.Enabled = False
I want to disable a label as soon as it is clicked however the code hides the label.
What I want is to disable it (make darkgrey and unclickable), not make it disappear.
Label3.Enabled = False
Add your onclick event like this:
AddHandler Label3.Click, AddressOf MyClickMethod
Keep track of the state of your click and implement your method like this:
Private _isActive As Boolean
Public Sub MyClickMethod(ByVal o As Object, ByVal e As EventArgs)
If _isActive Then
RemoveHandler Label3.Click, AddressOf MyClickMethod
_isActive = False
Else
AddHandler Label3.Click, AddressOf MyClickMethod
_isActive = True
EndIf
End Sub
Could be I'm missing some syntax, typing outside of visual studio