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 :
 
Ad

Advertisements

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
 
Ad

Advertisements

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
 

Top