OK, I know this has been posted before so sorry, but anyway...
What is best to use in this senario...
Is Ctype only usable when converting an object to the same type while DirectCast can be used to convert an object to the same type or a Base type?Code:Sub new(byref b as button) AddHandler b.MouseClick, AddressOf ButtonClick End Sub Private sub ButtonClick(byval sender as object, byval e as eventargs) Dim b as button = Ctype(sender, button) 'or Dim b as button = DirectCast(sender, button) b.text = "blahblah" end sub
Thanks in advance...




Reply With Quote