方法一:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
方法二:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
AddHandler CType(sender, WebBrowser).Document.Window.Error, AddressOf Window_Error
End Sub
Private Sub Window_Error(ByVal sender As Object, ByVal e As HtmlElementErrorEventArgs)
e.Handled = True ' 忽略错误并禁止弹出对话框
End Sub
C# 禁止 Webbrowser 控件的弹出脚本错误对话框
http://blog.csdn.net/davidhsing/article/details/5321700
[本日志由 tiancao1001 于 2017-12-26 10:53 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |