Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Problem with vb.net 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 |
| |||
| 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 |
| ||||
|
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 |
| |||
|
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] |
| ||||
|
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
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| problem, vbnet |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |