View Single Post

  #16 (permalink)  
Old 04-20-2004
Anthony_Hunt Anthony_Hunt is offline
Junior Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 14
Send a message via MSN to Anthony_Hunt
How to pushpin an address from VB

On a VB form with three address entry lines "address_line1" etc., a MapPoint control named "MapPointControl1", and a button named "btnFind".


Private Sub btnFind_Click()

Dim objPin As Pushpin
Dim objLoc As Location
Dim place As String

place = Me.address_line1.Text & ", " & Me.address_line2.Text & ", " & Me.address_line3.Text

Set objLoc = Me.MappointControl1.ActiveMap.FindResults(place).I tem(1)

If objLoc Is Nothing Then
Msgbox "Nothing Found"
Exit Sub
End If

Set objPin = Me.MappointControl1.ActiveMap.AddPushpin(objLoc, Me.address_line1.Text)
objPin.Symbol = 78 '# red house
objPin.note = place
objPin.BalloonState = geoDisplayBalloon

End Sub
Reply With Quote