I've never really used the tag property, but I've decided to try and use it. My senario: based on if a boolean value(playerturn) I set the tag property:
My issue is when I try to compare the tag. I try to here:
I throws an error:
Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.
but I'm not to sure how to do that. I know I've seen that error before, but I was able to use CType to clear that up.
Code:
Dim pnl As Panel = CType(sender, Panel)
With pnl
.BackgroundImage = createPlay()
.Enabled = False
End With
If playerTurn Then
playerTurn = False
pnl.Tag = "player"
Else
playerTurn = True
pnl.Tag = "cpu"
End If
Code:
If Panel1.Tag = "player" Then
End If
Quote:
Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.