3

I'm completely aware that a question of similar context has been asked many times (in many places including here), and potentially solved - I have definitely made a decent amount of research regarding the matter and have also realized the reason behind the script errors is most likely due to the WebBrowser control using the IE7 platform rather than the latest (IE9 in my case - I believe it's not really optional what control it uses)

Someone did post a work around, however it involves editing the registry via. code (something I cannot do as this application is being made out of my own good will for the company I work for), it doesn't mean however that i'm allowed to do things permitted to Administrators alone, especially tampering with something as delicate as the registry.

So in the end up, I want to ask you guys is there anyway at all you could provide me with a solution that 1. is inclusive and doesn't require any extra work, and 2. isn't just suppressing the errors, but instead adding that functionality back in by making it work (as some things that use scripts are quite key).

Is there a way of getting the control to use a different browser package, one I could possibly include in the installation setup?

Regards,

Hugh

4

1 回答 1

0

首先,如果你放:

    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>

在页面的 <header> 部分中,它将使用机器上安装的 IE 版本而不是默认的 IE 7 呈现

对于您的主要问题,为了避免 JavaScript 错误:

    WebBrowser wb = new WebBrowser();
    wb.ScriptErrorsSuppressed = true;

    //可选的:
    wb.ScrollBarsEnabled = false;

我用它来制作网页截图

于 2013-07-31T03:33:42.703 回答