MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Problem with vb.net

This is a discussion on Problem with vb.net within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I was able to show lan/lat infomation on status bar using private sub Mouse_move on .vb programming. Now I'm trying ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-29-2004
Junior Member
Yellow Belt
 
Join Date: May 2004
Posts: 23
Problem with vb.net

I was able to show lan/lat infomation on status bar using private sub Mouse_move on .vb programming.
Now I'm trying with vb.net, but lan/lat will not display correctly.
I was able to show lan/lat by zoom in and zoom out, but it will not show under mouse_move.

What am I missing?

XRoK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-30-2004
EdB EdB is offline
Member
Green Belt
 
Join Date: Aug 2002
Posts: 56
Post some code, let's have a look
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-30-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Code

Ok,
Here is the code for MouseMoveEvent

Private Sub AxMappointControl1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxMapPoint._IMappointCtrlEvents_MouseMoveEvent) Handles AxMappointControl1.MouseMoveEvent


Dim oLoc As MapPoint.Location
Dim dblLat As Double, dblLon As Double
Dim strPos As String
Dim strPosp As String
Dim x As Integer
Dim Y As Integer

oLoc = oMap.XYToLocation(x, Y)

CalcPos(oMap, oLoc, dblLat, dblLon)

Statusbar.panel(1).text = dblLat & "/" & dblLon

End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 10-30-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
I wonder if it is because your declaration of dblLat and dblLon is inside of your Private Sub AxMappointControl1_MouseMoveEvent ?
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 10-30-2004
Junior Member
Yellow Belt
 
Join Date: May 2004
Posts: 23
I think you went over my head..

Can you explain little more in my level, which isn't much.


XRoK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 10-31-2004
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 17
Send a message via ICQ to brianmcg
I'm a vb6 developer and haven't done anything with .net yet, but having said that, the XYtoLocation function must be passed the mouse coordinates in order to create the locations. In vb6, the event passes you the x and y of the mouse as parameters. You seem to be creating x and y as local variables and not assigning any values to them before calling the XYToLocation method. I may be missing something, but the way the code seems to work, you'll get the lat/long of whatever is in the top left corner of the map window (because that's (0,0) in the window and local integers are created with a value of 0) rather than anything to do with the mouse pointer.[/quote]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 10-31-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Your right I dont see anything for setting the x.y either.

Check out this article:
Programming MapPoint via .NET
http://www.mp2kmag.com/a66--location....mappoint.html

Code:
Private Sub OnMouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Integer, ByVal Y As Integer) Handles Map.MouseMove
Notice this sub declaration the x and y get passed in by mappoint.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 10-31-2004
EdB EdB is offline
Member
Green Belt
 
Join Date: Aug 2002
Posts: 56
I'm not sure if you got your answer yet, but I think it's here:

dim x as integer = e.x
dim y as integer = e.y

Make those changes and you should be fine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 11-01-2004
Junior Member
Yellow Belt
 
Join Date: May 2004
Posts: 23
Thanks EDB!

That's what i was missing..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 11-01-2004
EdB EdB is offline
Member
Green Belt
 
Join Date: Aug 2002
Posts: 56
Glad I could help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
problem, vbnet


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 07:58 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54