In another thread VJ made me aware of Tag. Fantastic! I've been
wanting this capability for a long time. But it seems that I cannot
use it with Option Strict On. In an event handler I have ...
Private Sub chkbxSelI_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
MsgBox("bingo for number " & sender.Tag.ToString)
End Sub
.... but with Option Strict On I get a complaint about "sender.Tag".
I looked up a brief article about Late Binding and I get the
impression that this is just the way it is. If you use Late Binding
you cannot use Option Strict On.
But I don't understand exactly what Late Binding it is complaining
about. I would guess that the compiler is concerned that he can't be
sure that sender.Tag is an Integer. But when I cast sender.Tag to an
Integer I still get a Late Binding error on sender.Tag.
I hate to give up Option Strict On, so I thought I'd ask here if there
is some way to use Option Strict On and still use Late Binding. Maybe
casting was the right idea but I did it wrong? Or maybe there is some
other way to pass info to my event handler which does not involve Tag.
Although I really like the idea of Tag. I think that I am using it
exactly the way it is intended to be used.
Thanks, Bob