Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

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?

like image 861
user276648 Avatar asked Jul 30 '10 11:07

user276648


1 Answers

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

like image 173
Daniel Argüelles Avatar answered Sep 18 '22 14:09

Daniel Argüelles