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

Get a simple handler

P: n/a
Hi All,

Like to get less code.
Can i get this to work without having de default handlers.

Private Sub GetDescription() Handles LB2.KeyUp, LB2.Click


Apr 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

No. You need the sender as object. The Click event is
expecting the second argument to be an mouseeventargs. The keyup event is
expecting the second argument to be an keyeventargs.

Ken
--------------------------
"Rob Willaar" <an*******@xs4all.nl> wrote in message
news:OU**************@TK2MSFTNGP14.phx.gbl...
Hi All,

Like to get less code.
Can i get this to work without having de default handlers.

Private Sub GetDescription() Handles LB2.KeyUp, LB2.Click

Apr 1 '06 #2

P: n/a

Rob Willaar wrote:
Hi All,

Like to get less code.
Can i get this to work without having de default handlers.

Private Sub GetDescription() Handles LB2.KeyUp, LB2.Click


I'm all for less code, too, but this approach won't get you there. =))

A method to handle an event must have the same signature of the event
it handles. If KeyUp and Click are the typical events we know and love,
then GetDescription can't handle them, because obviously their
signatures differ.

For this same reason, a handler can't handle events of different
signatures: notice that the signatures of KeyUp and Click don't match
each other.

It seems you must put appropriate handlers in place for each of the
events and have them call your GetDescription method...

Regards,

Branco.

Apr 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.