Export (0) Print
Expand All

Setting Dynamic Properties

Visual Studio .NET 2003

You use the Dynamic Properties dialog box to indicate on a property-by-property basis those values you want to write to the configuration file. By default, this dialog box lists each property that Microsoft has identified as being a likely candidate for configuration; for most components, this will be a subset of the available properties.

For each property you want to store, you identify the key that the value should be stored under in the project's configuration file. For example, if you are storing the ConnectionString property for a data connection called oledbConnection1, you might set the key for this value to be oledbConnection1.ConnectionString. The settings file would then store the current value of the ConnectionString property under this uniquely identified key.

To set a property to be dynamically stored

  1. Access the Properties window for the form, control, or component for which you want to set up dynamic properties.
  2. Set the values of any properties you want to store in the configuration file.
  3. Expand the DynamicProperties node.
  4. If the property you want to store is listed beneath this node, click the Ellipsis ( w65h17yt.vbellipsesbutton(en-us,VS.71).gif ) button next to it and do the following:
    1. Click Map property to a key in configuration file.
    2. If you want to change the value under which the property is stored, modify the setting of the Key field.
  5. If the property you want to store is not listed, click the Ellipsis ( w65h17yt.vbellipsesbutton(en-us,VS.71).gif ) button next to the Advanced property, and perform these steps in the dialog box that appears:
    1. In the Properties list box, select the check box next to the property whose value you want to store in an external file.
    2. In the Key Mapping drop-down box, either accept the default key or type a new key value by which you want the property's value to be stored.
    3. Click OK.
  6. Repeat step 4 or 5 for each property for which you want to store a value.
  7. Click OK to close the dialog box.

    All of the properties you chose to store dynamically are now listed in the DynamicProperties node of the Properties window.

See Also

Introduction to Dynamic Properties | Removing Keys from Properties | Changing the Value of Dynamic Properties | Walkthrough: Storing and Retrieving Dynamic Properties

Show:
© 2014 Microsoft