How To Make Web Browser Using GeckoFX In VB.NET

gecko is firefox  . we're going to make a fastest web browser using gecko firefox , i will tech you the basics only ok lets get started

first of all download this archive - download

finish downloading and extract the archive in c drive just extract it dont do anything and now create a new project and when form loaded right click in toolbox and select choose items


a windows will popup and now click browse and select Skybound.Gecko.dll(C://)


now click ok and see your toolbox you will see a new tool called geckowebbrowser now drag it to the form


when you put it in your form your form will  look like this it is the webbrowser set it as you wanted on the form1


add buttons

button1-back
button2-forward
button3-refresh
button4-go
button5-stop

add a textbox

textbox1

now double click your form and erase everything and add this 

Public Class Form1

    'Author : Mohamed Shimran
    'Blog : http://www.ultimateprogrammingtutorials.blogspot.com

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        GeckoWebBrowser1.GoForward()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        GeckoWebBrowser1.Refresh()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        GeckoWebBrowser1.Navigate(TextBox1.Text)
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        GeckoWebBrowser1.Stop()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GeckoWebBrowser1.GoBack()
    End Sub

    Private Sub GeckoWebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GeckoWebBrowser1.DocumentCompleted
        TextBox1.Text = GeckoWebBrowser1.Url.ToString
    End Sub
    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        Skybound.Gecko.Xpcom.Initialize("C:\xulrunner")

        ' Add any initialization after the InitializeComponent() call.
    End Sub
End Class
now debug and see how it working



15 comments

Nice tutorial. please can u post how to the form name to the current web title. Also, post the link where i can download the metro tab control and metro tracker.
Thanks in Advance

Reply

Thank you , if you want to get the title of the current webpage you can use Me.Text = GeckoWebBrowser1.DocumentTitle by the way i don't know what you mean by metro tab control and metro tracker , could you please explain more ?

Reply

(h)

Reply

It give one big problem with:

Initialize Component()
Skybound.Gecko.Xpcom.Initialize("C:\xulrunner")

i would like load xulrunner from subfolder like (Root)Debug \ Engine(SubFolder)

i try it on 2 ways
1.Skybound.Gecko.Xpcom.Initialize(Environment.CurrentDirectory & "\Engine")
2.Skybound.Gecko.Xpcom.Initialize(Application.Startupparth & "\Engine")

both did't work

pls need help to fix this problem

Greez Crusher

Reply

Hi,

Copy all the files into your app root directory and try this code Skybound.Gecko.Xpcom.Initialize(Application.StartupPath)

:)

Reply

GECKO = Good, Enourmous, Citadel, King, Offroad...

Reply

Can i use gecko for commercial?

Reply

Hi,
Is it possible to make a page loading progress bar?

Reply

Thanks for this post..
I've been looking this kind of additional control for my app the whole day..
:D

Reply

Hi,
In this gecko browser. How can I show the PDF to new window/tab?. Is any documentation available?

Thanks
Bala.

Reply

Yes just like you do for the default webbrowser control,

Reply

It doesn't have any official documentations.

Reply

can you give me the metro tabcontrol

Reply

Thanks for your great tutorial. Do you know weather it is possible to use WebRTC with GeckoFX? I've tested the compability with html5test.com and it says it should work. But I can't make it work. My guess is that i need so enable webcam. Any ideas?

Reply

Post a Comment