Hi,
I need to retrieve string from one form to another form. When I retrieved the latitude and longitude of my current location, I need to use my current latitude and longitude coordinates to link to another map form to display the map with my current location using the coordinates. I am this code, but I'm unable to link the coordinates to the map as I get the data from a string and I think I need to store the string somewhere before I can read the string from another form. How can I solve my problem?
This is my coding:
First form:
Private Sub btnMapIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMapIt.Click
Dim f As New Map(Latitude, Longitude)
Dim lat, lon As String
If Latitude <> String.Empty And Longitude <> String.Empty Then
txtLat.Text = lat
txtLong.Text = lon
f.Show()
End If
End Sub
Second form:
Public Sub New(ByVal lat As String, ByVal lon As String)
InitializeComponent()
If (lat = String.Empty Or lon = String.Empty) Then
Me.Dispose()
End If
Try
Dim queryAddress As New StringBuilder()
If lat <> String.Empty AndAlso lon <> String.Empty Then
queryAddress.Append("http://maps.google.com/?q=" & lon & "," & lat)
End If