Search code examples
c#google-mapswindows-forms-designer

Trying to add google maps in windows form


I am currently working on adding google maps into windows forms but I keep getting the error in the image below.

string search = textBox1.Text;
StringBuilder querysearch = new StringBuilder();
querysearch.Append("https://www.google.com/maps/");
if (search != string.Empty)
{
querysearch.Append(search);
}
webBrowser1.Navigate(querysearch.ToString());

enter image description here


Solution

  • You need to add this line:

    webBrowser1.ScriptErrorsSuppressed = true;
    

    To disable this JavaScript error.