By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,969 Members | 1,579 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,969 IT Pros & Developers. It's quick & easy.

EventHandler AddressOf Question

P: n/a
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 :
Jun 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sorry, I hit ctrl+enter!

Ok - the example was:

AddHandler dropDownList.SelectedIndexChanged, AddressOf
ddlPreSelectedResourceAccessLevelSelectedIndexChan ged

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

Regards

Rob
Jun 4 '07 #2

P: n/a
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
"Rob Meade" wrote:
Sorry, I hit ctrl+enter!

Ok - the example was:

AddHandler dropDownList.SelectedIndexChanged, AddressOf
ddlPreSelectedResourceAccessLevelSelectedIndexChan ged

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

Regards

Rob
Jun 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.