GeckoFX

Skybound

Skybound Software is looking to hire experienced C# developers to work on Stylizer and other forthcoming Skybound products. Click here for details.

GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control. Download GeckoFX @ Google Code >

GeckoFX is made by Skybound Software, authors of Stylizer—the professional CSS editor with a strong focus on visual control, error-free workflow, and productivity. Learn About Stylizer >

GeckoFX Forum

Discuss GeckoFX, the Open-Source Gecko Control for .NET

You are not logged in.

GeckoFX Home Pages & Preferences

#1 December 12, 2009 5:46 AM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

GeckoFX Home Pages & Preferences

Hey there, I've managed to get everything working apart from home pages & the preferences window.

With the old IE engine, it was as simple as "WebBrowser1.GoHome"; I've tried "GeckoWebBrowser1.GoHome" to no avail, can anyone shed some light on this? Thanks.

Also, anyone got any tips on how to get the "PropertiesDialog" to open?

I've done things like "Skybound.Gecko.GeckoPreferences.Load()" etc.

Thanks again,

JimmyEdmo

Offline

 

#2 January 10, 2010 1:39 PM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

Re: GeckoFX Home Pages & Preferences

Bump....

Offline

 

#3 January 12, 2010 1:32 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

What are you coding in? VB or C#? if its vb.net then how to get the homepage is like this

i use a setting which can be changed by the user.

i named the setting as hompage and set it as http://google.com then to navigate there on the home button i put

Wb.Navigate(My.Settings.homepage)

and for the proporties i dont know. search here i know its here some where.

Offline

 

#4 January 12, 2010 1:41 PM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

Re: GeckoFX Home Pages & Preferences

I'm coding in VB.

I'm sorry, but my mind has gone blank and have no idea how to "create" settings.

Thanks,
JimmyEdmo

Offline

 

#5 January 12, 2010 6:37 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

JimmyEdmo wrote:

I'm coding in VB.

I'm sorry, but my mind has gone blank and have no idea how to "create" settings.

Thanks,
JimmyEdmo

right click your project names Mines Crzy Browser so i right click on that then go to properties. in proporties go to settings

for name put homepage then for the value put what ever you want for the homepage i put google. then ill write up some code for ya later tonight when i work on my browser, so the user can change their homepage. I'm going to make it so that they can have more than one home page if they wish.

(if you got a working browser like a tabbed browser. Please oh please share. I'm really lost on that part.)

Offline

 

#6 January 13, 2010 10:48 AM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

Re: GeckoFX Home Pages & Preferences

Thanks ever so much mate, means a lot. :)

I'm on version 1.0.5 at the moment, I'm going to implement tabs in 1.1, so if you still need help when I'm there, give me a shout.

:)

Offline

 

#7 January 13, 2010 1:43 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

I still need help with tabs and a new windows. Right now im working on settings such as homepages and things.

So like i said how to  change homepage and thigns

Make a new form call it what you want

through label and a text box and a button. On the form load event put this

Me.textbox1.text = My.settings.homepage()

Then for them to change the homepage they just need to type in a new site in the text box

The button code will be

My.settings.save()

That will update and save the settings for the new homepage.

Hope that helps.

Offline

 

#8 January 13, 2010 3:10 PM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

Re: GeckoFX Home Pages & Preferences

I've done this and it works fine:

Code:

Imports Skybound.Gecko

Public Class PreferencesForm

    Private Sub PreferencesForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = My.Settings.Homepage
    End Sub

    Private Sub UseCurrentButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UseCurrentButton.Click
        TextBox1.Text = CType(XascoSurfForm.TabControl1.SelectedTab.Controls.Item(0), GeckoWebBrowser).Url.AbsoluteUri
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
        My.Settings.Homepage = TextBox1.Text
    End Sub

    Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
        Me.Close()
    End Sub

    Private Sub CancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancelButton.Click
        Me.Close()
    End Sub
End Class

And yes, I'm attempting to use tabs. :)

Last edited by JimmyEdmo (January 13, 2010 3:11 PM)

Offline

 

#9 January 13, 2010 3:55 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

I never thought of using the current page. Totally forgot about that. I've given up on tabs for now along with new windows for now and working more on getting the preferences worked out and bookmarks.

Offline

 

#10 January 13, 2010 3:57 PM

JimmyEdmo
Member
From: Kent
Registered: October 23, 2009
Posts: 8
Website

Re: GeckoFX Home Pages & Preferences

I've always wanted to know how to do bookmarks, if you do manage to get them sorted, let me know and I can give you some help with tabs. :)

Offline

 

#11 January 13, 2010 5:11 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

Sounds like a deal. Once i figure it out ill let ya know.

Offline

 

#12 January 15, 2010 3:27 PM

crzyone9584
Member
Registered: November 29, 2009
Posts: 25
Website

Re: GeckoFX Home Pages & Preferences

Here is a quick way for bookmarks. This isn't the best but it works for me for a beta release

Create a settings called Bookmark
Set the type to System.Collections.Specialized.StringCollection
Scope to User

Now click the little icon with the three ... enter just one value or you will get an error.

Then To show it just need a combo box ( i did this on another form for practice)

   

Code:

    Private Sub Bookmarks_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'list Bookmarks
        ListBox1.DataSource = My.Settings.Bookmarks
    End Sub

    Private Sub ListBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Click
        'navigate to clicked item
        Form1.Wb.Navigate(ListBox1.SelectedItem)
    End Sub

There you go. Short but good bookmark Not sure how to make it just show the sites name instead of the url. Also to add the bookmarks just make a button and add this code

Code:

My.Settings.Bookmarks.Add(Wb.Url.ToString)

Slight modification and make this for history to.

Hope you understood this Jimmy lol

Offline

 

#13 January 28, 2010 6:00 PM

saurabha88
Member
Registered: November 20, 2009
Posts: 1

Re: GeckoFX Home Pages & Preferences

For setting a Home page, just add this line to \xulrunner\defaults\pref\xulrunner.js

Code:

pref("browser.startup.homepage", "WEBSITE ADDRESS");

where WEBSITE ADDRESS can be any valid address, like, http://www.google.com

then in your code using C#, at any event, like on button_click,

Code:

{
geckoWebBrowser1.Navigate(Skybound.Gecko.GeckoPreferences.User["browser.startup.homepage"].ToString());
}

Hope this will help...

Offline

 

Board footer