confusion creating events & delegates (reading hardware buttons, opennetcf)
From: Mad Scientist Jr (usenet_daughter_at_yahoo.com)
Date: 07/07/04
- Next message: Doug Forster: "Re: Running MFC Apps on Pocket PC"
- Previous message: Mad Scientist Jr: "Re: voice recorder error - Namespace cannot be found"
- Next in thread: Kevin Aubuchon: "Re: confusion creating events & delegates (reading hardware buttons, opennetcf)"
- Reply: Kevin Aubuchon: "Re: confusion creating events & delegates (reading hardware buttons, opennetcf)"
- Messages sorted by: [ date ] [ thread ]
Date: 7 Jul 2004 15:14:03 -0700
i'm trying to include the hardware buttons control posted by
mastermind at
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=283&SearchTerms=hardware,buttons
in my vb.net project, but am having some trouble converting the
author's c# example to vb.net. particularly with creating the events.
here is what i have, and the errors i am getting
any help appreciated
captureHButtons = New CaptureHButtonsControl.CaptureHButtons
'//
'// captureHButtons
'//
'tried to convert this line to vb.net:
' this.captureHButtons.BindedButtonPressed += new
CaptureHButtonsControl.CaptureHButtons.KeyUpEventHandler(this.captureButtons_BindedButtonPressed);
'next line gives the following error:
' Public Event BindedButtonPressed(KeyCode As Integer)' is an event,
' and cannot be called directly.
' Use a 'RaiseEvent' statement to raise an event.
' and
' CaptureHButtonsControl.CaptureHButtons.CapturedButtonEventHandler'
is a delegate type.
' Delegate construction permits only a single AddressOf expression as
an argument list.
' Often an AddressOf expression can be used instead of a delegate
construction.
Me.captureHButtons.BindedButtonPressed += New
CaptureHButtonsControl.CaptureHButtons.CapturedButtonEventHandler(Me.captureButtons_BindedButtonPressed)
'tried to convert this line to vb.net:
' this.captureHButtons.RegisteredButtonPressed += new
CaptureHButtonsControl.CaptureHButtons.CapturedButtonEventHandler(this.captureButtons_RegisteredButtonPressed);
'next line gives the following error:
' Public Event BindedButtonPressed(KeyCode As Integer)' is an event,
' and cannot be called directly.
' Use a 'RaiseEvent' statement to raise an event.
' and
' CaptureHButtonsControl.CaptureHButtons.CapturedButtonEventHandler'
is a delegate type.
' Delegate construction permits only a single AddressOf expression as
an argument list.
' Often an AddressOf expression can be used instead of a delegate
construction.
Me.captureHButtons.RegisteredButtonPressed += New
CaptureHButtonsControl.CaptureHButtons.CapturedButtonEventHandler(Me.captureButtons_RegisteredButtonPressed)
- Next message: Doug Forster: "Re: Running MFC Apps on Pocket PC"
- Previous message: Mad Scientist Jr: "Re: voice recorder error - Namespace cannot be found"
- Next in thread: Kevin Aubuchon: "Re: confusion creating events & delegates (reading hardware buttons, opennetcf)"
- Reply: Kevin Aubuchon: "Re: confusion creating events & delegates (reading hardware buttons, opennetcf)"
- Messages sorted by: [ date ] [ thread ]