Common Events

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I can see that vb.net has the ability to have multiple controls
(consumers?) share in a single event, much like I do now in Delphi.

Looks like the use of delegates? in vb.net is involved.

How would I go about forcing multiple buttons to react to the same
button click? In Delphi, you just create a procedure with a matching
signature and assign it to the xxx.OnClick event, etc of object you
subscribe to the event. You can also do it in the object inspector.

Can someone provide a sample or link for accomplishing this via vb.net?

Thank you,
 
Lee,

To answer your qeustion for searchers in Google who find your message.

Add handlers using
\\\
AddHandler mycontrol.theevent, addressof Myprocedure
///

This can be simple done in a loop.

Cor
 
Cor Ligthert enlightened me by writing:
Lee,

To answer your qeustion for searchers in Google who find your message.

Add handlers using
\\\
AddHandler mycontrol.theevent, addressof Myprocedure
///

This can be simple done in a loop.

Cor

Thanks, Cor. I was just hooking up the events by adding the events to
the Handles section of the event signature through IDE.

Eventually, I would have needed to do it in code as well. Thanks for
the tip...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top