Zdravim, potřeboval bych udělat WebBrowser s jádrem Gecko. To je samo o sobě jednoduché, ale nevím si rady se záložkobým systémem na internetu jsem našel toto:
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Skybound.Gecko.Xpcom.Initialize("C:Program FilesMozilla Firefox")
End Sub
Private Sub BrowserCanGoBack_Changed(ByVal sender As Object, ByVal e As System.EventArgs)
'The sender is the browser.
Dim SelectedBrowser As Skybound.Gecko.GeckoWebBrowser = sender
MsgBox("The BrowserCanGoBack event was raised. " & SelectedBrowser.CanGoBack.ToString)
End Sub
Private Sub BrowserCanGoForward_Changed(ByVal sender As Object, ByVal e As System.EventArgs)
'The sender is the browser.
Dim SelectedBrowser As Skybound.Gecko.GeckoWebBrowser = sender
MsgBox("The BrowserCanGoForward event was raised. " & SelectedBrowser.CanGoForward.ToString)
End Sub
Public Sub BrowserDocumentTitle_Changed(ByVal sender As Object, ByVal e As System.EventArgs)
'The sender is the browser.
Dim SelectedBrowser As Skybound.Gecko.GeckoWebBrowser = sender
'Set the tabpage text by getting the parent of the browser control
SelectedBrowser.Parent.Text = SelectedBrowser.DocumentTitle
End Sub
Private Sub BrowserTabsAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BrowserTabsAdd.Click
'Create new tabpage
Dim NewTab As New TabPage("about:blank")
'Assign a unique name to identify it
NewTab.Name = "NewTab"
'Create new GeckoWebBrowser instance
Dim Browser As New Skybound.Gecko.GeckoWebBrowser
Browser.Name = "Browser"
'Fill entire tabpage
Browser.Dock = DockStyle.Fill
'Assign events
AddHandler Browser.CanGoBackChanged, AddressOf BrowserCanGoBack_Changed
AddHandler Browser.CanGoForwardChanged, AddressOf BrowserCanGoForward_Changed
AddHandler Browser.DocumentTitleChanged, AddressOf BrowserDocumentTitle_Changed
'Add browser to tabpage
NewTab.Controls.Add(Browser)
'Add tabpage to tabcontrol
BrowserTabs.TabPages.Add(NewTab)
Browser.Navigate("http://www.google.com/")
End Sub
Bohužel to nefunguje a je divné že je to závislé na Firefoxu. Hází to chybu: http://upsource.xf.cz/upload/12-9-09-09-... Jsem začátečník a vůbec si nevím rady :-( děkuji za každou radu.
|