An original tutorial with detailed snapshots can be found here .
To embed the Gecko browser in your winform application, you need to:
- XulRunner: XULRunner is a Mozilla runtime package that you can use to download XUL + XPCOM applications that are as rich as Firefox and Thunderbird. It provides mechanisms for installing, updating, and uninstalling these applications. XULRunner can be downloaded here . Select the version you want.
GeckoFx.net build file, which you can download from here . Also select the correct version that matches the XulRunner version.
Unzip GeckoFX-330.zip, you will get the files below:
- Add the links to the DLL as shown above, click the browse button and select Geckofx-Core.dll and Geckofx-Winforms.dll
- In the toolbar, right-click, and then select "Select Item", select Geckofx-Winforms.dll, and the Geformo winform control will be displayed in the toolbar.
Drag the GeckoWebBrowser control into the winform constructor and call it "browser"
In the form1.cs file, add the code below:
String Gecko.Xpcom.Initialize (@ ".. \ xulrunner"); indicates where the xulrunner runtime is located. In this case, we put it in the folder (@ ".. \ xulrunner").
Now run the application, yes ~~~
David
source share