user276648 user276648 - 1 year ago 86
C# Question

Automatically update the Application Setting using the binding from VS.Net Designer

It's possible to bind a property to an existing application setting using the designer, that way I don't have to write something like

textBox.Text = Settings.Default.Name;

when initializing my form.

Now it looks like the binding stops there, ie if I change the value of my setting, it won't update the value in my textbox and vice versa.

Is it normal or am I missing something?

Answer Source

I'll explain how I do it on windows forms with Visual Studio 2010. It is likely similar in newer versions.

  1. Click on the component to bind (textbox, checkbox, ...)
  2. Make component's properties panel visible
  3. Expand the node ApplicationSettings
  4. Click the ... button to the right of (PropertyBinding)

    Get application settings for component

  5. Choose which setting you want the control bound to.

There is a more detailed tutorial at Exploring Secrets of Persistent Application Settings

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download