Search code examples
c#winformswebbrowser-control

How to define which web browser will be used from the webBrowser control?


I am trying to use Google Maps in a Windows Form project (visual C#).

The form has a button and when the user clicks the bellow code is executed!

queryAddress.Append("http://maps.google.com/maps?z=12&t=m&q=loc:36.948827+26.982906");
webBrowser1.Navigate(queryAddress.ToString());

Normaly the browser that is embedded in the webBrowser control should have opened the map, but all I am seeing is the message for the unsupported browser!

enter image description here

I found a solution here, but either way I cannot understand it. Is there a way to define which web browser will be used by the webBrowser control?

If also anybody is boring to death and want to explain me that solution it would be greatly appreciated!


Solution

  • i am not sure if the article you posted refers to the same problem you have but i can explain what it says. The article exposes that the WebBrowser is using an olver version of IE to render the webpage and therefore it causes the error.

    The solution given is to go into the windows registry, which you can do if you hit the Windows + R keys on your machine, opening a Run command and then typing in: regedit

    This will open the windows registry Editor and in here you will see 4 groups of items, you will need to navigate to the one described on the article which is

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl
    

    So first open the HKEY_LOCAL_MACHINE key, that will display further options, look for the SOFTWARE key now, this will display further options so continue this process untill you reach the last node FeatureControl and here look for the node called FEATURE_BROWSER_EMULATION.

    If you do not find the Wow6432Node it means your PC is 32 bits in which case you would only have to modify this in HKEY LOCAL MACHINE > SOFTWARE > MICROSOFT > INTERNET EXPLORER > MAIN > FEATURE CONTROL > FEATURE_BROWSER_EMULATION

    Then right click on the right side panel and click on the NEW option that displays from the menu and then DWORD, replace New Value #1 with the name of your application.exe and then for the value put 11000.

    I hope this helps