0

The internet browser in visual basic is the internet explorer 7.How to change the version to a newer one?I searched on google but nothing worked.Here is what i have tried.The suggested answers are in c#.Doesnt help me

Dim AppName = IO.Path.GetFileName(Application.ExecutablePath)
     My.Computer.Registry.CurrentUser.CreateSubKey("SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\FeatureControl")
      My.Computer.Registry.SetValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\FeatureControl", AppName, "1000", Microsoft.Win32.RegistryValueKind.DWord)
  • Apart from the incorrect value, note that that code works only after restarting your app and running it _without_ Visual Studio's hosting process (the latter applies only to versions of VS older than 2017, in that case start your application directly from the .exe.). – Visual Vincent Feb 11 '19 at 17:06
  • 2
    Note that the accepted answer of the question that Andrew Morton linked, is using the `HKEY_LOCAL_MACHINE` branch of the Registry. **Don't do that**. Use the `HKEY_CURRENT_USER` one (with `Registry.CurrentUser`). I suggest you also read this one: [Web browser control emulation issue (FEATURE_BROWSER_EMULATION)](https://stackoverflow.com/a/28626667/7444103) and this one: [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/a/38514446/7444103) – Jimi Feb 11 '19 at 17:06
  • In addition to @Jimi's comment, using `HKEY_LOCAL_MACHINE` requires your application to run with administrative privileges. `HKEY_CURRENT_USER` does not. – Visual Vincent Feb 11 '19 at 17:09
  • Another problem with accepted answer in the suggested duplicate is that it tries to adapt to a 64-bit system by setting the value under the `Wow6432Node` **regardless** of whether the current process is a 32-bit or 64-bit process. The `Wow6432Node` is only used by 32-bit applications and they will be redirected there automatically by the [Registry Redirector](https://docs.microsoft.com/en-us/windows/desktop/winprog64/registry-redirector), no need for your app to do anything extra. – Visual Vincent Feb 11 '19 at 17:14
  • 1
    VB.NET alternative, which lets the Registry Redirector do its job: Possible duplicate of [Webpage works in IE, Chrome and Firefox, but not when using the .NET WebBrowser control](https://stackoverflow.com/questions/42365833/webpage-works-in-ie-chrome-and-firefox-but-not-when-using-the-net-webbrowser) – Visual Vincent Feb 11 '19 at 17:15
  • This is what I used https://social.msdn.microsoft.com/Forums/vstudio/en-US/bc469203-cb4a-4477-a8b3-996121b424e6/webbrowser?forum=vbgeneral – CruleD Feb 11 '19 at 19:38
  • it is not working.I dont run it with the debugger so i dont have to add .vshost.exe – Stelios Liakopoulos Feb 11 '19 at 20:59
  • You just need to add the name of your executable (.exe included), under the `FEATURE_BROWSER_EMULATION` key, not under `FEATURE_BROWSER_EMULATION\FeatureControl`. `FeatureControl` is the name of the upper level key. Give another look at the linked answers – Jimi Feb 11 '19 at 22:05
  • ok i will try it and see if it works – Stelios Liakopoulos Feb 12 '19 at 12:13

0 Answers0