0

I'm working on a web browser where the default search engine is Google until the user clicks on the Yahoo (or another search engine) button. The problem is, after you start a new session, it opens with Google again. How to you save that?

I'm aware how to save settings with Properties.Settings.Default.Save(); however it doesn't seem to work with a click event. (Where the code is to change the search engine)

I'm using GeckoFX. Code for the Yahoo setting is:

        goo.Enabled = true;
        y.Enabled = false;
        bin.Enabled = true;
        ba.Enabled = true;
        ya.Enabled = true;
        sear.Text = "Yahoo!";

And is performed with:

        if (y.Enabled == false)
        {
            W.Navigate("search.yahoo.com/search?p=" + q.Text);
            W.Select();
        }
Tom
  • 6,325
  • 4
  • 31
  • 55
CCCP
  • 215
  • 3
  • 14
  • 1
    Are you sure settings aren't simply overriden by VS when you rerun application? (VS will overwrite what's inside target folder). Moreover only user settings can be changed (machine settings are read only). – Adriano Repetti Sep 05 '13 at 21:49
  • Why not write the setting to an `xml` file and then check the file for settings when you start the app –  Sep 05 '13 at 21:53
  • Are we sure he's talking about an app he's writing? It sounds like maybe he just needs help w/ Chrome or Firefox. We need to see some code! – crthompson Sep 05 '13 at 22:04
  • How are you setting the engine in the first place? By default, the `WebBrowser` control uses Internet Explorer settings. – Arian Motamedi Sep 05 '13 at 22:38
  • You could use a database... – arodebaugh Dec 01 '15 at 21:02

0 Answers0