Community of VE/MapPoint Users and Developers
This is a discussion on drag and drop pushpin within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I want to drag a pushpin from a location to another pushpin. The idea being the user drags a vehicle ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
|
I hope this will get you started. For this sample you will need a circle named "MyShape" so I've included some code to create the shape, please run that code before trying the main example. After you have you circle on the map, add a pushpin, then drag and drop it into the circle (the depot) Good luck... Code:
'call this sub from the MapPoint Controls AfterRedraw event
On Error Resume Next
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim objShapes As MapPointCtl.Shapes
Dim objshape As MapPointCtl.Shape
Set objShapes = objmap.Shapes
Dim objRecords As MapPointCtl.Recordset
Dim objDataSet As MapPointCtl.DataSet
If TypeOf objmap.Selection Is Pushpin Then
Dim a_pin As MapPointCtl.Pushpin
Set a_pin = objmap.Selection
For Each objshape In objmap.Shapes
If objshape.Name = "MyShape" Then
For Each objDataSet In objmap.DataSets
Set objRecords = objDataSet.QueryShape(objshape)
objRecords.MoveFirst
Do Until objRecords.EOF
If objRecords.Pushpin.Name = a_pin.Name Then
MsgBox "You moved " & objRecords.Pushpin.Name & " (" & a_pin.Name & ") into the circle"
End If
objRecords.MoveNext
Loop
Next
End If
Next
End If
Code: 'Run this at startup or from a command button
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim objShapes As MapPointCtl.Shapes
Dim objshape As MapPointCtl.Shape
Set objShapes = objmap.Shapes
Set objshape = objShapes.AddShape(geoShapeRadius, objmap.FindResults("Denver, CO").Item(1), 500, 500)
objshape.Name = "MyShape"
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| drag, drop, pushpin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Drag and Drop with mappoint | Ryder | MapPoint 2006/2009 Discussion | 1 | 03-11-2005 02:53 PM |
| Drag/Drop | Anonymous | MapPoint 2006/2009 Discussion | 0 | 12-01-2004 08:04 AM |
| drag & drop | starbuck | MapPoint 2006/2009 Discussion | 1 | 10-23-2003 12:21 PM |
| Mappoint 2002 OCX drop & drag | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-08-2003 03:57 PM |
| It is possible to drag / drop (move) an PushPin on.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 12-03-2001 03:54 AM |