FindPushpin method
Finds a Pushpin of a specified name. Returns the Pushpin object. Returns "Nothing" if the find results are ambiguous, or if there is no match.
Applies to
Objects: Map
Syntax
object.FindPushpin(Name)
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a Map object. |
Name |
Required String. The name of the Pushpin to find. |
Remarks
To access data associated with a Pushpin, use the MoveToPushpin method on a Recordset object.
To open the Find dialog box for user input, use the ShowFindDialog methodon the Map object.
Example
[Microsoft Visual Basic 6.0]
Sub ChangeFoundPushpinSymbol()
Dim objApp As New MapPoint.Application
Dim objPin As MapPoint.Pushpin
'Set up the application
objApp.Visible = True
objApp.UserControl = True
objApp.OpenMap objApp.Path + "\Samples\Clients.ptm"
'Find a Pushpin, then select it and change its symbol
Set objPin = objApp.ActiveMap.FindPushpin("Elizabeth Boyle Lucerne Publishing")
objPin.Select
objPin.Symbol = 171
End Sub
[C#]
void ChangeFoundPushpinSymbol()
{
MapPoint.ApplicationClass objApp = new MapPoint.ApplicationClass();
MapPoint.Map objMap = null;
MapPoint.Pushpin objPin = null;
//Set up the application
objApp.Visible = true;
objApp.UserControl = true;
objApp.OpenMap(objApp.Path + "\\Samples\\Clients.ptm",false);
objMap = objApp.ActiveMap;
//Find a Pushpin, then select it and change its symbol
objPin = (MapPoint.Pushpin)objMap.FindPushpin(
"Elizabeth Boyle Lucerne Publishing");
objPin.Select();
objPin.Symbol = 171;
}
Note This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.