Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void wbrWebPanel_Navigated( object sender, WebBrowserNavigatedEventArgs e )
- {
- SuppressErrorDialogs();
- }
- private void wbrWebPanel_FileDownload( object sender, EventArgs e )
- {
- SuppressErrorDialogs();
- }
- /// <summary>
- /// Used to suppress error message dialogs from the browser control
- /// Not using ScriptErrorsSuppressed as this also suppresses NTLM (and other) dialogs.
- /// http://stackoverflow.com/a/7841596/1973027
- /// </summary>
- private void SuppressErrorDialogs()
- {
- if ( wbrWebPanel.Document != null && wbrWebPanel.Document.Window != null )
- {
- this.wbrWebPanel.Document.Window.Error += ( o, args ) => args.Handled = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement