MouseWheel Event on a picture box (Newbie)

R

rossmclean

Hi,
I'm trying to get the mouse wheel event, but i cant quite nail it! I
have tried a few things, but I never get it to work, although I did
have it working at one point, but now it's stoped!!!

I have in my form code:

Sub PicBoxMap_MouseWheel(ByVal sender As Object, ByVal e As
system.Windows.Forms.MouseEventArgs)
'///
end sub

And in the designer:

AddHandler Me.PicBoxMap.MouseWheel, AddressOf Me.PicBoxMap_MouseWheel

this complies but does not fire.


When i add the handles like this:

form code:

Sub PicBoxMap_MouseWheel(ByVal sender As Object, ByVal e As
system.Windows.Forms.MouseEventArgs) Handles PicBoxMap.MouseWheel

Desinger code:

AddHandler Me.PicBoxMap.MouseWheel, AddressOf Me.PicBoxMap_MouseWheel

Dim WithEvents PicBoxMap_MouseWheel As
System.Windows.Forms.MouseEventArgs

I get the following 3 errors:

Method 'Private Dim WithEvents PicBoxMap_MouseWheel As
System.Windows.Forms.MouseEventArgs' does not have the same signature
as delegate 'Delegate Sub MouseEventHandler(sender As Object, e As
System.Windows.Forms.MouseEventArgs)'. (BC30408) -

Handles clause requires a WithEvents variable defined in the
containing type or one of its base types. (BC30506)

'PicBoxMap_MouseWheel' is already declared as 'Private Dim WithEvents
PicBoxMap_MouseWheel As System.Windows.Forms.MouseEventArgs' in this
class. (BC30260)

I have looked and tried diffrent combinations of things, but i dont
really understand what I need to do, can someone help me out!

Many thanks
Ross
 
K

kimiraikkonen

Hi,
I'm trying to get the mouse wheel event, but i cant quite nail it! I
have tried a few things, but I never get it to work, although I did
have it working at one point, but now it's stoped!!!

I have in my form code:

Sub PicBoxMap_MouseWheel(ByVal sender As Object, ByVal e As
system.Windows.Forms.MouseEventArgs)
'///
end sub

And in the designer:

AddHandler Me.PicBoxMap.MouseWheel, AddressOf Me.PicBoxMap_MouseWheel

this complies but does not fire.

When i add the handles like this:

form code:

Sub PicBoxMap_MouseWheel(ByVal sender As Object, ByVal e As
system.Windows.Forms.MouseEventArgs) Handles PicBoxMap.MouseWheel

Desinger code:

AddHandler Me.PicBoxMap.MouseWheel, AddressOf Me.PicBoxMap_MouseWheel

 Dim WithEvents PicBoxMap_MouseWheel As
System.Windows.Forms.MouseEventArgs

I get the following 3 errors:

Method 'Private Dim WithEvents PicBoxMap_MouseWheel As
System.Windows.Forms.MouseEventArgs' does not have the same signature
as delegate 'Delegate Sub MouseEventHandler(sender As Object, e As
System.Windows.Forms.MouseEventArgs)'. (BC30408) -

Handles clause requires a WithEvents variable defined in the
containing type or one of its base types. (BC30506)

'PicBoxMap_MouseWheel' is already declared as 'Private Dim WithEvents
PicBoxMap_MouseWheel As System.Windows.Forms.MouseEventArgs' in this
class. (BC30260)

I have looked and tried diffrent combinations of things, but i dont
really understand what I need to do, can someone help me out!

Many thanks
Ross

Look at this similiar thread:
http://groups.google.com/group/micr.../browse_thread/thread/9d29f248cc2b3a70?hl=en#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top