| 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 |