Sunday, April 27, 2014

Visual Basic .NET Tutorial 52 - How to Display Google Maps in VB.NET






Imports System.Text
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim street As String = TextBox_street.Text
        Dim city As String = TextBox_city.Text
        Dim state As String = TextBox_state.Text
        Dim zip As String = TextBox_zip.Text

        Try
            Dim queryAddress As New StringBuilder
            queryAddress.Append("http://maps.google.com/maps?q=")

            If TextBox_street.Text <> String.Empty Then
                queryAddress.Append(street + "," & "+")
            End If
            If TextBox_city.Text <> String.Empty Then
                queryAddress.Append(city + "," & "+")
            End If
            If TextBox_state.Text <> String.Empty Then
                queryAddress.Append(state + "," & "+")
            End If
            If TextBox_zip.Text <> String.Empty Then
                queryAddress.Append(zip + "," & "+")
            End If

            WebBrowser1.Navigate(queryAddress.ToString)

        Catch ex As Exception
            MessageBox.Show("Unable to retrive date")
        End Try

    End Sub
End Class








---------------------------------------------------------------

Show Your Data on Google Map using VB.NET
How to add google maps in a VB.NET  Program
VB.NET  - how to display address in google map
Display Google Map in Windows Form - VB.NET  / C Sharp
display google maps in VB.NET  application
VB.NET  And Google Maps - VB.NET
Integrating Google Maps with VB.NET
Embed Google Maps in VB.NET
how to show locations in a Google map
Google Maps in VB.NET  Web Application

No comments:

Post a Comment