问题
we are targeting our winforms webbrowser control to IE8 with registry key of 8000.
Below are the issues , frequently we face
- Script errors which are not seen on IE are visible using webbrowser control.
- web page rendering issues on webbrowser control, works fine on IE
- Few dropdownlists doesn't work on webbrowser control
回答1:
- Try this code to set the
FEATURE_BROWSER_EMULATION. If you have access to the web pages you're loading into
WebBrowser, useX-UA-Compatible:<head> <meta http-equiv="X-UA-Compatible" content="IE=8" /> ... </head>You can also try
IE=EmulateIE8, the difference is explained here.Once the above has been done, verify the actual document mode:
webBrowser.DocumentCompleted += (s, e) => MessageBox.Show( ((dynamic)webBrowser.Document.DomDocument).documentMode.ToString());
来源:https://stackoverflow.com/questions/24723173/how-to-make-winforms-webbrowser-control-to-work-very-similar-to-targeted-interne