map in winform

Ali Maleki Lonbar 1 Reputation point
2021-06-06T11:27:41.26+00:00

How can I display the map in Windows Form and show the Directtion & Route between two desired points on the map.

Developer technologies Windows Forms
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,651 Reputation points
    2021-06-07T02:43:09.053+00:00

    Hi AliMalekiLonbar-2401,
    You can achieve it via WebBrowser control.
    Here is a simple code:

    private void Form1_Load(object sender, EventArgs e)  
    {  
        // UpdateGoogleMap();  
        StringBuilder queryAddress = new StringBuilder();  
        // Open locally stored html file in webbroswer control.  
        //  queryAddress.Append("C:\\GMtest\\GoogleMapsV3.html");  
        //Open Google's map  
        queryAddress.Append("https://www.google.com/maps/dir/");  
        this.webBrowser1.Navigate(queryAddress.ToString());  
    }  
    

    And there are more methods has been provided in the threads below you can refer to.
    Maps with Windows Forms application
    Display a map in a Windows Form app
    Interactive Google maps on a C# winform
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.