Results 1 to 22 of 22

Thread: Identify a control from parameters passed to event handler?

Threaded View

  1. #13
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Well, in VB.NET using sender.<some radiobutton property> will work because VB.NET allows late binding. But in C# for example you can only use methods/properties from sender's type (object), if you want to use radiobutton's one you will have to do casting first.
    In C# you will have to use casting if you want to use sender as an RadioButton. Vb.Net will allow you to do for example sender.LOL(), and even compile without raising any error.
    Now run the app..Wow! An error! That's the bad part about late binding - the compiler CAN'T know if you are trying to access something that doesn't exist or not.

    And if you are using a big loop that is resource intensive it will have to each time check what kind of object it is before calling the method/property you want, making your application lots slower.
    Last edited by PT Exorcist; May 28th, 2004 at 03:16 PM.
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width