在 WebBrowser 控件 VB.NET 中捕获新窗口

发布于 2024-12-22 10:23:44 字数 321 浏览 2 评论 0原文

我一直在寻找,但无法准确找到我需要的东西。我需要在 VB.NET 中的 WebBrowser 控件中包含一个弹出窗口

我找到了这个项目: http ://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx

但我一直无法从中解析出我需要的内容。看起来它实现了我所需要的,但我不太确定它到底是如何做到的。我只需要捕获一个弹出窗口并将其显示在新的 WebBrowser 对象中。

I've been searching a bit and I haven't been able to exactly find what I need. I need to contain a popup window within the WebBrowser control in VB.NET

I found this project: http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx

But I've been having trouble parsing out what I need from it. It looks like it implements what I need, but I'm not really sure how the heck it's doing it. I just need to capture a popup and display it in a new WebBrowser object.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落花随流水 2024-12-29 10:23:44
Private Sub WebBrowser1_NewWindow(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
    Dim myelement As HtmlElement = WebBrowser1.Document.ActiveElement
    Dim target As String = myelement.GetAttribute("href")
    Dim newinstance As New WebBrowser
    newinstance.Show()
    newinstance.Navigate(target)
    e.Cancel = True
End Sub
Private Sub WebBrowser1_NewWindow(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
    Dim myelement As HtmlElement = WebBrowser1.Document.ActiveElement
    Dim target As String = myelement.GetAttribute("href")
    Dim newinstance As New WebBrowser
    newinstance.Show()
    newinstance.Navigate(target)
    e.Cancel = True
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文