Community of VE/MapPoint Users and Developers
This is a discussion on Trying to get the MapPoint.Location at a mouse event within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I need to present a MapPoint map to the user and allow him to click (or double-click) the location ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Trying to get the MapPoint.Location at a mouse event I need to present a MapPoint map to the user and allow him to click (or double-click) the location of interest. Then I'd like to get the MapPoint.Location which corresponds to his click. I don't think the mouse-down or mouse-up events will work, since I want the user to be able to use the default mouse features of MapPoint to select his active map area. So I think that means I need to use double-click, and that causes a problem since MapPoint will display a dialog with nearby addresses, upon a double click. I woud like to find out how to retrieve the address selected by the user, but I don't know how. So I have been left with overriding BeforeDblClick, but this code only gets called if the user double-clicks on a part of the map where there are not too many streets. If he double-clicks where there are other roads, the dialog willcome up and my code won't get called. Any ideas? Thanks. |
| |||
|
Hi, Use the BeforeClick and check the Shift or Control. So user have control or if he click with Shift or Ctrl he has your code.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| I tried using the keyboard too, but without success
Hi, I actually quickly tried the Ctrl and Alt keys, but they didn't help. When I override the BeforeDblClick event, the MapPoint dialog of addresses sometimes gets the event, leaving my code untouched. It turns out that when I double-click in a area with lots of street and intersections, the MapPoint dialog comes up displaying alternatives. But if I click away from other streets, I get the event in my BeforeDblClick event handler. Would anybody know how to get the address selected by the user? Any selection in the dialog will obviously be close, and I only need the lat/long actually. But this dialog (of MapPoint's) is stealing the event so my event handler never gets the lat/long of the mouse double-click. Thanks, Bob |
| |||
|
Hi, I just checked, and you only can see if the shift was pressed down. So you can determine the dfference. If shift was pressed down you set Cancel to True and this will cancel the action that mappoint will normally do, so you can safe execute your code. You dont have the lat/long in the clickevent but you have the x/y coordinates of the screen, so you can use them.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| event, mappointlocation, mouse |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Capturing Mouse Wheel Event | Anonymous | MapPoint Web Service and Virtual Earth | 2 | 11-30-2005 08:31 AM |
| find city name & state name on mouse move event | Atul22 | MapPoint 2006/2009 Discussion | 2 | 10-15-2004 05:28 AM |
| is there a way of geting the location of the mouse pointer | matt1168 | MapPoint 2006/2009 Discussion | 3 | 07-04-2003 02:25 PM |
| mouse down event | henemonster | MapPoint 2006/2009 Discussion | 1 | 03-31-2003 03:04 PM |
| Mouse Down Event -> Form_DB.Show-> Problems with Varia | blackmap | MapPoint 2006/2009 Discussion | 3 | 01-29-2003 08:17 AM |