View Single Post

  #3 (permalink)  
Old 05-05-2008
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Re: How to detect a particular pushpin

Hi,

I tryed the following code in a button click:

Code:
Location loc = MP.ActiveMap.GetLocation(lat, lon, alt);
Pushpin pp  = MP.ActiveMap.AddPushpin(loc, "Wilfried");
thePP = pp;
Then add a few more Pushpins. Then this code in selectionChange:

Code:
Pushpin pp = MP.ActiveMap.Selection as Pushpin;
if (pp != null)
    if (pp == thePP)
        Console.Beep();
It beeps when pp is the same one as the one assigned to thePP with AddPushpin, and it does not when I select others. So this comparistion works good.
Reply With Quote