View Full Version : DoubleClick Event

11-14-2006, 04:49 AM

I'm new to programming with mapPoint 2006.

I've got a VB.Net 2005 application where I add a pushpin on a mappoint control, displaying a clients address. It should be possible for the user to move the pushpin to an other location by doubleclicking the map.
To allow that I capture the beforeDbClick event in which I remove the current pushpin and a new one on the position the user clicked. The mapPointControl is placed on an other control which a load into the screen on run-time.

I've got 2 problems with this.

1. When I doubleClick next to a road I get a popup menu with following items in it: "GTM+1, Eat Flanders, Belgium, ..." Is there a possibility to not show this? A property that I can set so mappoint doesn't show this?

2. When I doubleClick on a road mappoint puts a bullet on that location but my pushpin isn't moved to that location. My pushpin gets moved when I doubleClick the map for the second time (I doesn't have to be on the same location). What am I doing wrong? Or isn't it possible to do what I'm trying to do?

11-14-2006, 12:32 PM

BeforeClick is also fired when you double click. So you have to set code over there also. In both events set the cancel property to true. Then you are the one in control.

11-15-2006, 04:26 AM

If I set the cancel property to true in the before double click event there is now event left to catch the double click. How can I catch a double click on the map then?

What I do now is, I catch the event "on selection changed" to replace my pushpin but this works both single and double click while it can only happen on a double click (order of the customer :sad: ).

Any idea's on how to do that?

11-15-2006, 04:41 AM
I found the solution.

In the on click event I set the prooperty cancel to true and on the before double clikc event I change the location of the pushpin by using the method XYToLoaction. This works.

The only problem that I have now is that you can't scroll the map because of the on click method. is there a way to allow the user to scrol but capture all the other single click events?

11-15-2006, 01:18 PM

By scrool you meen pan the map with the arrows when you move the mouse near the borders of the map window? You have to set some boolean to know what to do in BeforeClick. If it is the time to add/move pushpin or not.