0

I'm using the following code to embed the gecko in my application:

Dim browser As Gecko.GeckoWebBrowser

Gecko.Xpcom.Initialize("C:\temp\MozilaTeste\xulrunner")
browser = New Gecko.GeckoWebBrowser

Me.Controls.Add(browser)
browser.Dock = DockStyle.Fill
browser.Navigate("http://www.aol.com")

But my application freezes after call browser.Navigate("http://www.aol.com"). I'm using VS2010 Express. I've downloaded the xulrunner and extracted it to "C:\temp\MozilaTeste\xulrunner". I've downloaded the gecko fx and added the geckofx-core-14.dll and Geckofx-Winforms-14.dll to the project reference.

Sammy Davis
  • 117
  • 4
  • 13
  • As a side note, `Me.Controls.Add(browser)` and `browser.Parent = Me` are equivalent and therefore redundant. Use one or another. – GSerg Jan 18 '13 at 09:28

2 Answers2

0

May be problem in path to xulrunner dir? Try to use "\" . My code (xulrunner dir in the debug folder): Gecko.Xpcom.Initialize(AppDomain.CurrentDomain.BaseDirectory + "xulrunner\");

John
  • 76
  • 1
  • 1
  • 7
0

Comment out the following line:

browser.Navigate("http://www.aol.com")

Does it still freeze?

If No then move the navigate into the Window Created Event handler.

The GeckoWebBrowser control initializes itself when the WinForms Control is created. The Navigate needs to be called after the control is successfully initialized.

Tom
  • 6,325
  • 4
  • 31
  • 55