我正在尝试在 Visual Studio 2008 的帮助下在 VB 中使用 WebKit 组件(http://www.webkit.org/)。
这运行没有问题,除了以下两个问题: 1. 未显示提示/工具提示(例如,如果您将鼠标悬停在 Google 徽标上,通常会出现一个) 2. 如果有一个弹出窗口,我不知道如何获取新的所需 URL。
我已经在这件事上工作了几天,但还没有找到任何解决方案:(
也许你知道解决这个问题的方法。
干杯马库斯G。
PS:如果你需要多于下面的Source Code来分析问题,那就让我知道...
源代码表格1
Imports System.IO
Imports WebKit
Public Class frmMain
Private _url As String
Private _mode As String
Private _popupUrl As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
On Error Resume Next
Dim bLogging As Boolean
setWindowAndBrowserSettings()
_url = "http://www.google.com"
browserComp.Navigate(_url)
End Sub
Private Sub setWindowAndBrowserSettings()
Me.Text = "Test - Browser"
Me.WindowState = FormWindowState.Maximized
browserComp.Dock = DockStyle.Fill
browserComp.Visible = True
End Sub
Private Sub browserComp_NewWindowCreated(ByVal sender As Object, ByVal e As WebKit.NewWindowCreatedEventArgs) Handles browserComp.NewWindowCreated
'frmPopup.WindowState = FormWindowState.Maximized
frmPopup.Text = "ixserv - POPUP"
frmPopup.popup.Navigate(_popupUrl)
frmPopup.Show()
End Sub
Private Sub browserComp_NewWindowRequest(ByVal sender As Object, ByVal e As WebKit.NewWindowRequestEventArgs) Handles browserComp.NewWindowRequest
e.Cancel = False
_popupUrl = browserComp.Url.ToString ' WHERE can I get the clicked URL? This is the old one of the remaining window
End Sub
End Class
代码表格2
Public Class frmPopup
End Class