?
Solved

Can't Make WebBrowser control in VB.NET  use IE8 Standards Mode

Posted on 2011-02-20
4
Medium Priority
?
2,990 Views
Last Modified: 2012-05-11
I am working on a desktop application in VB.NET that uses a WebBrowser control on a form. The WebBrowser control is pointed at a .htm file on the local hard drive. When I open the application this file looks a total mess because it's designed for standards-compliant browsers - when I open it in IE8 it looks fine and when I switch to IE7 compatibility mode in IE8, it looks as it does in my application, so it seems my WebBrowser control is somehow forced into IE7 mode. The .htm file has a valid DOCTYPE of XHTML-strict.

Things I have tried so far to overcome the problem include:

Adding each of these to the head section of the .htm file:

<!--<meta http-equiv="X-UA-Compatible" content="IE=IE8" />-->
<!--<meta http-equiv="X-UA-Compatible" content="IE=Edge" />-->

Adding each of these to the registry:

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe" = dword 8000 (Hex: 0x1F40)

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"vshost32.exe" = dword 8000 (Hex: 0x1F40)

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe" = dword 8888 (Hex: 0x22B8)

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"vshost32.exe" = dword 8888 (Hex: 0x22B8)

None of the above makes any difference to the problem.
0
Comment
Question by:wwarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Author Comment

by:wwarby
ID: 34936238
I have now also tried uploading the .htm file to a web server to rule out the possibility that there is something specific about the behaviour of the WebBrowser control when using a local file. There isn't - it behaves the same when running from a web server hosted page.
0
 
LVL 1

Author Comment

by:wwarby
ID: 34936427
I have now also confirmed exactly which mode the WebBrowser control is in using JavaScript. It's Internet Explorer 8 running in Compatibility Mode with the document in IE7 Standards mode. Nothing I do seems to make the document run in IE8 Standards mode.
0
 
LVL 13

Accepted Solution

by:
F Igor earned 2000 total points
ID: 34936703
It not a "server" problem. Only on the client browser (IE8)
Check if you use the correct name of your application ("MyApplication.exe") in the registry entry:

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe" = dword 8000 (Hex: 0x1F40)

This is a "per program" entry (only applies to the programs that use the webbrowser control.
If it will work you should program an internal registry setting when you deploy your app to another computer...
0
 
LVL 1

Author Closing Comment

by:wwarby
ID: 34936776
Urgh. You know what the problem turned out to be? I'd forgotten I had to use the Wow6432Node registry path as I'm on a 64 bit platform. I wasn't setting the right registry key. As soon as I put it in the right place, it worked fine.

Thanks for the response anyway - it made me reconsider how I'd done the registry key which ultimately led to a solution ;)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question