EDIT:
Se riferito al progetto che già abbiamo visto, metti una textbox, nel mio codice Text2, all'interno della picturebox, il progetto completo diventa:
Private Declare Function InternetOpen Lib "WININET" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetOpenUrl Lib "WININET" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Private Declare Function InternetReadFile Lib "WININET" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetCloseHandle Lib "WININET" (ByVal hInet As Long) As Integer
Private Declare Function DeleteUrlCacheEntry Lib "WININET" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Dim pushpin_0_x As Integer
Dim pushpin_0_y As Integer
Dim pushpin_1_x As Integer
Dim pushpin_1_y As Integer
Dim coordinate_0 As String
Dim coordinate_1 As String
Private Sub Form_Load()
carica_sito ("http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0=37,3107,13,5766;3;AGRIGENTO&wp.1=43,4628,11,8807;9;AREZZO&mapsize=640,480&C=IT&mapMetadata=1&format=jpeg&key=Ap94-koskdt-HryTYKhaJf5GLnuzjt3uLkl5AyKQnIYw6m6QPmiDIxJSWW_1AJ_1")
Picture1.Picture = LoadPicture(App.Path & "\MappaArezzoAgrigento.bmp")
Form1.ScaleMode = 3
Picture1.ScaleMode = 3
Text2.Appearance = 0
Text2.BackColor = vbYellow
Text2.Visible = False
End Sub
Public Sub carica_sito(url)
Dim hOpen As Long
Dim hOpenUrl As Long
Dim sURL As String
Dim bDoLoop As Boolean
Dim bRet As Boolean
Dim sReadBuffer As String * 2048
Dim lNumberOfBytesRead As Long
sBuffer = ""
sURL = url
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
hOpenUrl = InternetOpenUrl(hOpen, sURL, vbNullString, 0, INTERNET_FLAG_RELOAD, 0)
bDoLoop = True
While bDoLoop
DoEvents
sReadBuffer = vbNullString
bRet = InternetReadFile(hOpenUrl, sReadBuffer, Len(sReadBuffer), lNumberOfBytesRead)
sBuffer = sBuffer & Left$(sReadBuffer, lNumberOfBytesRead)
If Not CBool(lNumberOfBytesRead) Then bDoLoop = False
Wend
If hOpenUrl <> 0 Then InternetCloseHandle (hOpenUrl)
If hOpen <> 0 Then InternetCloseHandle (hOpen)
Text1.Text = sBuffer
Call Interpreta(CStr(sBuffer))
End Sub
Private Sub Interpreta(json As String)
Dim pos1 As Long
Dim pos2 As Long
pos1 = 1
pos1 = InStr(pos1, json, "coordinates", vbTextCompare)
pos2 = InStr(pos1 + 1, json, "]", vbTextCompare)
List1.AddItem ("coordinate centro mappa: " & Mid(json, pos1 + 13, pos2 - pos1 - 12))
pos1 = InStr(pos2, json, "pushpin", vbTextCompare)
pos2 = InStr(pos1 + 1, json, "}", vbTextCompare)
Dim pushpin_0 As String
pushpin_0 = Mid(json, pos1 + 22, pos2 - pos1 - 22)
List1.AddItem ("pushpin_0: " & pushpin_0)
pos1 = InStr(pos2, json, "coordinates", vbTextCompare)
pos2 = InStr(pos1 + 1, json, "]", vbTextCompare)
coordinate_0 = Mid(json, pos1 + 13, pos2 - pos1 - 12)
List1.AddItem ("coordinate_0: " & coordinate_0)
pos1 = InStr(pos2, json, "anchor", vbTextCompare)
pos2 = InStr(pos1 + 1, json, "}", vbTextCompare)
Dim pushpin_1 As String
pushpin_1 = Mid(json, pos1 + 9, pos2 - pos1 - 9)
List1.AddItem ("pushpin_1: " & pushpin_1)
pos1 = InStr(pos2, json, "coordinates", vbTextCompare)
pos2 = InStr(pos1 + 1, json, "]", vbTextCompare)
coordinate_1 = Mid(json, pos1 + 13, pos2 - pos1 - 12)
List1.AddItem ("coordinate_1: " & coordinate_1)
pos1 = InStr(1, pushpin_0, ":""", vbTextCompare)
pos2 = InStr(pos1, pushpin_0, """,", vbTextCompare)
pushpin_0_x = CInt(Mid(pushpin_0, pos1 + 2, pos2 - pos1 - 2))
List1.AddItem ("pushpin_0_x = " & pushpin_0_x)
pos1 = InStr(pos2 + 2, pushpin_0, ":""", vbTextCompare)
pos2 = InStr(pos1 + 2, pushpin_0, """", vbTextCompare)
pushpin_0_y = CInt(Mid(pushpin_0, pos1 + 2, pos2 - pos1 - 2))
List1.AddItem ("pushpin_0_y = " & pushpin_0_y)
pos1 = InStr(1, pushpin_1, ":""", vbTextCompare)
pos2 = InStr(pos1, pushpin_1, """,", vbTextCompare)
pushpin_1_x = CInt(Mid(pushpin_1, pos1 + 2, pos2 - pos1 - 2))
List1.AddItem ("pushpin_1_x = " & pushpin_1_x)
pos1 = InStr(pos2 + 2, pushpin_1, ":""", vbTextCompare)
pos2 = InStr(pos1 + 2, pushpin_1, """", vbTextCompare)
pushpin_1_y = CInt(Mid(pushpin_1, pos1 + 2, pos2 - pos1 - 2))
List1.AddItem ("pushpin_1_y = " & pushpin_1_y)
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X > pushpin_1_x - 7 And X < pushpin_1_x + 7 And Y > pushpin_1_y - 15 And Y < pushpin_1_y - 4 Then
Text2.Top = pushpin_1_y - 10
Text2.Left = pushpin_1_x + 20
Text2.Text = coordinate_1
Text2.Visible = True
ElseIf X > pushpin_0_x - 7 And X < pushpin_0_x + 7 And Y > pushpin_0_y - 15 And Y < pushpin_0_y - 4 Then
Text2.Top = pushpin_0_y - 10
Text2.Left = pushpin_0_x + 20
Text2.Text = coordinate_0
Text2.Visible = True
Else
Text2.Visible = False
End If
End Sub