EventHandler AddressOf Question

R

Rob Meade

Hi all,

I have the need to use an EventHandler programmatically, but I want to know
move the code I've written - hard code - to a simple generic class, but to
do so I need the event handler statement to take a variable....can this be
done?

ie..

Instead of :
 
R

Rob Meade

Sorry, I hit ctrl+enter!

Ok - the example was:

AddHandler dropDownList.SelectedIndexChanged, AddressOf
ddlPreSelectedResourceAccessLevelSelectedIndexChanged

...how can I make the ddlPreSelectedResourceAccessLevelSelectedIndexChanged a
variable thats passed in so that I can call one of two functions depending
etc...
Any help appreciated..

Regards

Rob
 
G

Guest

Have it declared as the delegate type used by
dropDownList.SelectedIndexChanged, and also omit the "AddressOf" keyword.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top