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 >
Discuss GeckoFX, the Open-Source Gecko Control for .NET
You are not logged in.
Pages: 1
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
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
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
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
I've done this and it works fine:
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 ClassAnd yes, I'm attempting to use tabs. :)
Last edited by JimmyEdmo (January 13, 2010 3:11 PM)
Offline
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
Sounds like a deal. Once i figure it out ill let ya know.
Offline
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)
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 SubThere 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
My.Settings.Bookmarks.Add(Wb.Url.ToString)
Slight modification and make this for history to.
Hope you understood this Jimmy lol
Offline
For setting a Home page, just add this line to \xulrunner\defaults\pref\xulrunner.js
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,
{
geckoWebBrowser1.Navigate(Skybound.Gecko.GeckoPreferences.User["browser.startup.homepage"].ToString());
}Hope this will help...
Offline
Pages: 1