View Full Version : Pin Selected Manualy, how to use in Code

10-12-2011, 09:27 AM
Ok All

why is it sometimes the easiest thing stumps you. I select a Pin on a map, then wish to use code to process it.

can determine a Pin is slected with the below, but the I want to make an variable = the Pin

oPin has been Dim as MapPoint.Pin

If Not TypeOf oMap.Selection Is MapPoint.Pushpin Then
MsgBox("Not a Pin")


MsgBox("Is Pin")
oPin = xxxxxxx

' so I can then be checking the Name, Location etc against other things and thenn draw a Radius.

Mad, been working with Vertices which ithought would be hard.



10-12-2011, 09:39 AM
:stupid2: oPin = oMap.Selection

Eric Frost
10-12-2011, 09:50 AM
Thanks for the follow up! Yeah I was going to say it should be simple :-)

Also, check the Events if you are not using them already. The Help file has good sample code. Where I have used that before is with the SelectionChange event.

Events (http://msdn.microsoft.com/en-us/library/gg662913.aspx)
AfterRedraw event (http://msdn.microsoft.com/en-us/library/gg674772.aspx)
AfterViewChange event (http://msdn.microsoft.com/en-us/library/gg674773.aspx)
BeforeClick event (http://msdn.microsoft.com/en-us/library/gg674774.aspx)
BeforeClose event (http://msdn.microsoft.com/en-us/library/gg674775.aspx)
BeforeDblClick event (http://msdn.microsoft.com/en-us/library/gg674776.aspx)
BeforeSave event (http://msdn.microsoft.com/en-us/library/gg674778.aspx)
DataMapChange event (http://msdn.microsoft.com/en-us/library/gg674779.aspx)
MouseDown event (http://msdn.microsoft.com/en-us/library/gg674780.aspx)
MouseMove event (http://msdn.microsoft.com/en-us/library/gg674781.aspx)
MouseUp event (http://msdn.microsoft.com/en-us/library/gg674782.aspx)
New event (http://msdn.microsoft.com/en-us/library/gg674783.aspx)
NewDataSet event (http://msdn.microsoft.com/en-us/library/gg674784.aspx)
Open event (http://msdn.microsoft.com/en-us/library/gg674790.aspx)
Quit event (http://msdn.microsoft.com/en-us/library/gg674791.aspx)
ReadyStateChange event (http://msdn.microsoft.com/en-us/library/gg674792.aspx)
RouteAfterCalculate event (http://msdn.microsoft.com/en-us/library/gg674793.aspx)
RouteAfterOptimize event (http://msdn.microsoft.com/en-us/library/gg674794.aspx)
SelectionChange event (http://msdn.microsoft.com/en-us/library/gg674795.aspx)