Http://tieba.baidu.com/F? Kz= 177310026 VB Baidu post it http://tieba.baidu.com/F? KW = VB & Fr = ala0 Method 1: Private sub commandementclick () Webbrowser1.navigate text1.text 'click command1 to open the URL of text1 End sub Private sub form_resize () If me. windowstate <> 1 then webbrowser1.width = me. scalewidth: webbrowser1.height = me. scaleheight-webbrowser1.top 'adjust webbrowser1 to the window size End sub Private sub webbrowser1_newwindow2 (ppdisp as object, cancel as Boolean) If option1.value = true then' if a single segment option1 (open in the current window) Set ppdisp = webbrowser2.application Webbrowser2.zorder 'Open webbrowser2. Jump to webbrowser2_beforenavigate2. Else' if you select to open in a new window Dim newform as new form1 Newform. Show 'a new form1 window is displayed. Set ppdisp = newform. webbrowser1.application Newform. webbrowser1.zorder 'Open in the new form1 window. End if End sub Private sub webbrowser2_beforenavigate2 (byval Pdisp as object, URL as variant, flags as variant, targetframename as variant, postdata as variant, headers as variant, cancel as Boolean) Webbrowser2.stop 'webbrowser2 stopped Webbrowser1.stop 'webbrowser1 stopped Webbrowser1.navigate URL 'webbrowser1 open URL End sub Method 2: Private sub webbrowser1_newwindow2 (ppdisp as object, cancel as Boolean) Cancel = true Webbrowser1.navigate2 webbrowser1.document. activeelement. href End sub Method 3: Dim withevents web_v1 as shdocvwctl. webbrowser_v1 Private sub form_load () Set web_v1 = webbrowser1.object Webbrowser1.navigate2"Www.sina.com" End sub Private sub web_v1_newwindow (byval URL as string ,_ Byval flags as long ,_ Byval targetframename as string ,_ Postdata as variant ,_ Byval headers as string ,_ Processed as Boolean) Processed = true Webbrowser1.navigate URL End sub Note that dim withevents web_v1 as shdocvwctl. webbrowser_v1 Put in commonCodeLi |