Share via


ShowFindDialog method

Opens the Find dialog box. Returns either a Pushpin (if finding a Pushpin) or Location object. Returns Nothing if there is no match.

Applies to

Objects: Map

Syntax

object.ShowFindDialog(Name, [FindState], [HwndParent], [AutoConfirmExactMatch])

Parameters

Part

Description

object

Required. An expression that returns a Map object.

Name

Required String. Name of the place to search for; similar to typing a place name in the Find dialog box.

FindState

Optional GeoFindState. The Find dialog box tab to display. Default value is geoFindDefault.

GeoFindState Value Description
geoFindAddress 1 Opens the Find dialog box with the Address tab displayed.
geoFindDefault 0 Opens the Find dialog box with the tab that corresponds to the item that is searched for.
geoFindLatLong 3 Opens the Find dialog box with the Lat/Long tab displayed.
geoFindOSGrid 4 Opens the Find dialog box with the OS Grid tab displayed. Available only in MapPoint Europe.
geoFindPlace 2 Opens the Find dialog box with the Place / Data tab displayed.

HWndParent

Optional Long. Handle of the user's window, to allow the Find dialog box to be modal to a window in the calling application, rather than MapPoint.

Note   Do not use a handle for a window other than the MapPoint window if the MapPoint window is visible.

AutoConfirmExactMatch

Optional Boolean. Hides the Find dialog when an exact match is found. Default is False.

Remarks

  • If the FindState parameter is other than geoFindDefault, the string in the Name parameter is use as the entry on the tab of the Find dialog box that's opened.

  • If the FindState parameter is geoFindlatLong, MapPoint uses the list separator to separate the latitude and longitude coordinates when evaluating the Name parameter. For example, if the comma is designated as the list separator on a user's machine, everything to the left of a comma is considered the latitude coordinate and everything to the right of a comma is considered the longitude coordinate.

  • To find a collection of locations that are possible find matches to an address; similar to using the Address tab on the Find dialog box, use the FindAddressResults method on the Map object.

  • To find a Pushpin of a specified name, use the FindPushpin method on the Map object.

  • To return a collection of locations and Pushpins (FindResults collection) that are possible place and address find matches based on an input string; similar to the Find box on the Navigation toolbar, use the FindResults method on the Map object.

  • To return a collection of locations and Pushpins (FindResults collection) that are possible find matches based on an input string; similar to the Place tab on the Find dialog box, use the FindPlaceResults method on the Map object.

Example

[Microsoft Visual Basic 6.0]

Sub FindWashingtonMonumentInDialog()

Dim objApp As New MapPoint.Application

'Set up the application
objApp.Visible = True
objApp.UserControl = True

'Display the Find dialog
objApp.ActiveMap.ShowFindDialog "Washington Monument", geoFindPlace

End Sub

[C#]

void findWashingtonMonumentInDialog()
{
int parentWindow = 0;
MapPoint.ApplicationClass objApp = new MapPoint.ApplicationClass();

//Set up the application
objApp.Visible = true;
objApp.UserControl = true;

//Display the Find Dialog
objApp.ActiveMap.ShowFindDialog("Washington Monument", GeoFindState.geoFindPlace, parentWindow, false);
}

Note   This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.