vb2008 WebBrowser How to suppress script error prompts and Popup dialog boxes

Source: Internet
Author: User

1. When the form is initialized, the WebBrowser control's

scripterrorssuppressed = True

(False debug mode, allow script error prompts), or it can be set in other appropriate events.

2. Writing a sub-process

Private Sub Window_error (ByVal sender as Object, _ ByVal e as Htmlelementerroreventargs) ' Ignore Error and suppress popup dialog e.handled = True E nd Sub
3. Call the preceding sub-procedure in the Browser_documentcompleted event of the WebBrowser control, with the following code:

(ByVal sender as Object, _ ByVal e as WebBrowserDocumentCompletedEventArgs) AddHandler CType (sender, WebBrowser). Document.Window.Error, _ AddressOf window_error End Sub

Note: Browser is a WebBrowser control name, such as WebBrowser1.

Http://blog.sina.com.cn/s/blog_40d47c890100n0gn.html

Other methods:

Http://zhidao.baidu.com/question/124054234.html?fr=qrl&cid=867&index=1&fr2=query

Webbrowser1.silent = True

The simplest thing to do is to solve

Http://zhidao.baidu.com/question/70363713.html?fr=qrl&cid=867&index=1

Best Answer



Private Sub Timer1_timer () III = III + 1 If III >= 0 Then Dim dlghwnd As Long Dim buttonhwnd As Long dlghwnd = FindWindow ("#32770", "Microsoft Internet Explorer") Buttonhwnd = GetDlgItem (Dlghwnd, 2) ' of which 2, is obtained by using Spy + + C9/>sendmessage Buttonhwnd, Bm_click, 0&, ByVal 0& End If End Sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.