I'm trying to use the following code fromt he MSDN so that I can capture mouse events int he mappoint ocx:
'This code requires that you have a list box on your form
Dim WithEvents objApp As MapPoint.Application
Dim WithEvents objMap As MapPoint.Map

Private Sub Form_Load()
'Set up the application
Set objApp = CreateObject("mappoint.application")
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
End Sub

Private Sub objMap_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
List1.AddItem "MouseDown event fired"
End Sub

Private Sub objMap_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
List1.AddItem "MouseMove event fired"
End Sub

Private Sub objMap_MouseUp(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
List1.AddItem "MouseUp event fired"
End Sub
However, when I put this into vb.net, I get an error on the "Dim withevents" lines syaing that the "'withevents' variable does not raise any events. I'm assuming this is why I can't get it to fire any events from the mouse.

Any help would be great

Cheers

M