0
好吧我嘗試了谷歌搜索的所有內容,嘗試了文檔Awesomium中的示例,但它沒有奏效。我有一個標籤式瀏覽器。我如何讓每個webcontrol處理showcreatedwebview事件。VB.NET Awesomium在新窗口中打開target_blank示例
好吧我嘗試了谷歌搜索的所有內容,嘗試了文檔Awesomium中的示例,但它沒有奏效。我有一個標籤式瀏覽器。我如何讓每個webcontrol處理showcreatedwebview事件。VB.NET Awesomium在新窗口中打開target_blank示例
此爲窗口創建
Private Sub Mainwindow_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
PictureBox2.Enabled = False
TextBox1.Text = Clipboard.GetText
WebControl1.Source = New Uri(TextBox1.Text)
End Sub
這對您的瀏覽器
Private Sub WebControl1_ShowCreatedWebView(ByVal sender As Object, ByVal e As Awesomium.Core.ShowCreatedWebViewEventArgs) Handles WebControl1.ShowCreatedWebView
Clipboard.SetText(e.TargetURL.ToString)
Dim webControl As Awesomium.Windows.Forms.WebControl = TryCast(sender, Awesomium.Windows.Forms.WebControl)
Form1.Tabcontrol1.TabContainer.AddTab(New Mainwindow, True, Form1.Tabcontrol1.TabContainer.TabCount)
Dim webControl11 As WebControl = TryCast(sender, WebControl)
If webControl Is Nothing Then Return
If Not webControl.IsLive Then Return
Mainwindow.Close()
If e.IsPopup AndAlso (Not e.IsUserSpecsOnly) Then
' JSWindowOpenSpecs.InitialPosition indicates screen coordinates
ElseIf (e.IsWindowOpen OrElse e.IsPost) Then
Else
e.Cancel = True
Mainwindow.TextBox1.Text = e.TargetURL.ToString
' Show the window.
Form1.Tabcontrol1.TabContainer.AddTab(New Mainwindow, True, Form1.Tabcontrol1.TabContainer.TabCount)
End If
End Sub
End Class
沒關係發現了這件事...... – hackstockz
你可以刪除這個問題,然後 – voytek