Open the pop-up web page using the NewWindow2 event of the Web Browser control.

xiaoxiao2021-03-06  18

THIS

.axwebbrowser1.newwindow2

=

New

Axshdocvw.dwebbrowserevents2_newwindow2eventhandler

THIS

.axwebbrowser1_newwindow2;

Private

Void

AxWebBrowser1_newwindow2 (

Object

Sender, axshdocvw.dwebbrowserevents2_newwindow2event e)

...

{Browserform Form = New Browserform (); form.mdiparent = this.mdiparent; E.ppdisp = form.axwebbrowser1.application; form.show ();

Where axwebbrowser1_newwindow2 is the response function of NewWindow2, just manually create a new MDI sub-window after capturing events and pass the Application value of the AxWebBrowser in the sub-window to E.ppdisp. It should be noted that the E.CANCEL property cannot be set to TRUE.

转载请注明原文地址:https://www.9cbs.com/read-63442.html

New Post(0)