Option Strict and Late Binding

  • Thread starter Thread starter Felicity
  • Start date Start date
F

Felicity

Hello,

I have the following code.

Private Sub ABC_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnA.Click, btnB.Click,
btnC.Click

if sender.name = "btnA" then
Do something etc, etc
else
Do something else etc, etc
end if

End Sub

This code works fine until I turn Option Strict On. Then
I get a blue line under the words "sender.name" with the
following message "Option Strict On disallows late
binding". I am unsure how to get access to the properties
of the button clicked in this situation using "sender".

Can anyone point me in the write direction?

Thanks

Felicity
 
Back
Top