Moin
Meine erste frage bei vb paradise
also ich hab mir einen browser programmiert mit tabs usw. aber die ie engine ist doooof XD
ich hab schon geschafft die gecko engine normal zu machen ohne tabs das ging problemlos.
Aber wie mache ich das mit tabs?
DJburner
P.S. Wie lade ich etwas runter?
P.S.2 Der quellcode ist ein bissl unübersichtlich, hab ihn nochmal im anhang.
Meine erste frage bei vb paradise
also ich hab mir einen browser programmiert mit tabs usw. aber die ie engine ist doooof XD
ich hab schon geschafft die gecko engine normal zu machen ohne tabs das ging problemlos.
Aber wie mache ich das mit tabs?
DJburner
P.S. Wie lade ich etwas runter?
P.S.2 Der quellcode ist ein bissl unübersichtlich, hab ihn nochmal im anhang.
VB.NET-Quellcode
- Public Class Form2 Dim browser As New WebBrowser Private Sub GO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GO.Click getaktiverbrowser() browser.Navigate(url.Text) End Sub
- Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize TabControl1.Width = Me.Width - 17 TabControl1.Height = Me.Height - 97 url.Width = Me.Width - url.Left - 185 GO.Left = url.Left + +url.Width + 6 Button4.Left = GO.Left + GO.Width + 6 Button5.Left = Button4.Left + Button4.Width + 6 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click getaktiverbrowser() browser.GoBack() End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click getaktiverbrowser() browser.GoForward() End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click browser.GoHome() End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try For Each favorit In My.Settings.Favorit bookmarks.Items.Add(favorit) Next Catch ex As Exception End Try
- addtab("CarbonTab", "about:blank") getaktiverbrowser() Button2.Top = Button2.Top GO.Top = Button2.Top Button3.Top = Button2.Top End Sub Private Sub BeendenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BeendenToolStripMenuItem.Click End End Sub
- Private Sub url_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles url.KeyDown If e.KeyCode = Keys.Enter Then GO_Click(GO, New System.EventArgs) End If End Sub
- Private Sub chronik() Me.Text = browser.DocumentTitle & " - Carbon" url.Text = browser.Document.Url.AbsoluteUri Dim i As Integer For i = 0 To url.Items.Count - 1 If url.Items(i).ToString = browser.Document.Url.AbsoluteUri Then Exit Sub End If Next url.Items.Add(browser.Document.Url.AbsoluteUri) End Sub
- Public Sub getaktiverbrowser() For Each wb As WebBrowser In TabControl1.SelectedTab.Controls browser = wb Exit For Next End Sub
- Public Sub addtab(ByVal name As String, ByVal url As String) Dim tab As TabPage = New TabPage(name) Dim wb As WebBrowser = New WebBrowser wb.Navigate(url) wb.Dock = DockStyle.Fill tab.Controls.Add(wb) AddHandler wb.DocumentCompleted, AddressOf browserfertig AddHandler wb.Navigating, AddressOf browserseiteladen AddHandler wb.DocumentCompleted, AddressOf chronik TabControl1.TabPages.Add(tab) TabControl1.SelectedTab = tab End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click addtab("CarbonTab", "about:blank") getaktiverbrowser() End Sub
- Private Sub browserfertig() If Not browser.DocumentTitle.ToString = Nothing Then TabControl1.SelectedTab.Text = browser.DocumentTitle End If End Sub
- Private Sub browserseiteladen() TabControl1.SelectedTab.Text = "Lädt" End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TabControl1.TabPages.Remove(TabControl1.SelectedTab) getaktiverbrowser() End Sub
- Private Sub button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button6.Click Dim i As Integer For i = 0 To bookmarks.Items.Count - 1 If bookmarks.Items(i).ToString = browser.Document.Url.AbsoluteUri Then Exit Sub End If Next Try getaktiverbrowser() My.Settings.Favorit.Add(browser.Url.ToString) My.Settings.Save() bookmarks.Items.Add(browser.Url.ToString) Catch ex As Exception End Try End Sub Private Sub bookmarks_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles bookmarks.SelectedIndexChanged getaktiverbrowser() browser.Navigate(bookmarks.Text) End Sub
- Private Sub bookmarks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bookmarks.Click
- End Sub
- Private Sub ÜberToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÜberToolStripMenuItem.Click Dialog1.Show() End SubEnd Class