Dela via


How to: Bind a Property to an Existing Application Setting Using the Designer

This topic demonstrates how to use Visual Studio to bind a property on a form or bind a control to an application setting you have already defined.

The following steps show you how to bind existing application settings to properties on your forms or controls. An application setting is represented in an application by a property in a wrapper class derived from ApplicationSettingsBase.

You can bind both bound and unbound settings with these steps. A bound setting is one that has already been bound to another property on a form or control in your project. With the settings architecture, you can bind multiple properties to a single setting; binding a setting to another property does not unset any of the previous bindings. An unbound setting is a setting whose bindings you have deleted, or a setting you have defined but not previously bound to any property.

For information about how to modify or remove an existing binding, see How to: Modify a Property Binding for Application Settings Using the Designer.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

To bind a property to an existing application setting using Visual Studio

  1. Select the form or control which defines the property to which you want to bind your setting.

  2. On the Property Editor, expand the (ApplicationSettings) node near the top of the grid; this will reveal the (PropertyBindings) node.

  3. Click the empty cell next to the (PropertyBindings) node, and then click the ellipsis button (...) that appears.

  4. On the Application Settings dialog box, find the property you want to bind and select the drop-down list next to it. The list shows all of the settings in your application. If you have organized your settings into groups, or have added multiple settings classes in your project, you will see your settings arranged as a hierarchical tree, with the setting group name in bold and the settings belonging to that group underneath it.

  5. Select the setting to which you want to bind this property by activating the check box next to the setting's name.

  6. Close the Application Settings dialog box.

See Also

Tasks

How to: Create Application Settings Using the Designer

Concepts

Application Settings Overview