2015-06-21 18 views

回答

-1

此爲窗口創建

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