public partial class Text : UserControl {
public Text()
{
InitializeComponent();
browser.Navigated += new NavigatedEventHandler(browser_Navigated);
}
void browser_Navigated(object sender, NavigationEventArgs e)
{
HideScriptErrors(browser, true);
}
public void HideScriptErrors(WebBrowser wb, bool Hide)
{
FieldInfo fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic);
if (fiComWebBrowser == null)
return;
object objComWebBrowser = fiComWebBrowser.GetValue(wb);
if (objComWebBrowser == null)
return;
objComWebBrowser.GetType().InvokeMember( "Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] { Hide });
}