|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get a simple handlerHi 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 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 -------------------------- Show quoteHide quote "Rob Willaar" <anonym***@xs4all.nl> wrote in message news:OUFnQuVVGHA.1740@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 > > > > Rob Willaar wrote:
> Hi All, I'm all for less code, too, but this approach won't get you there. =))> > Like to get less code. > Can i get this to work without having de default handlers. > > Private Sub GetDescription() Handles LB2.KeyUp, LB2.Click 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.
Option Strict On
disabling controls by checking off a radio button when the form loads Can't close EXCEL from my VB.NET application Currently logged in user's email SENDMail ContainsFocus equivalent in VB Get Memory Usage of my Program Invoking CTRL+C,X,V programatically Double-Buffering in VB2005? save string var to html file without losing format |
|||||||||||||||||||||||