Asociate dinamically an event in VB.net

  • Thread starter Thread starter Juan
  • Start date Start date
J

Juan

Hello:

I'm creating some radiobuttons and i want to asociate their events
dinamically with a function. How can I do it?

In c# there is no trouble, because it can handle with it:

radiobutton1.click += new System.eventhandler(this.myfunction);

but when i use VB.NET I need to do in this way:

public sub myfunction() handles radiobutton1.click

Thanks

Juan
 
Either use a comma after the first Handles to add more controls... or use
the VB equivalent of += which is:
AddHandler obj.Event, AddressOf SomeMethod

Cheers
Daniel
 
Back
Top