使用vb的 WebBrowser控件时怎么防止在新的页面打开

就是要保证他一种在本窗口链接
2024-12-16 20:26:43
推荐回答(1个)
回答1:

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
WebBrowser1.Navigate2 (WebBrowser1.Document.activeElement.href)
End Sub