Setting Dynamic Properties
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
- Access the Properties window for the form, control, or component for which you want to set up dynamic properties.
- Set the values of any properties you want to store in the configuration file.
- Expand the DynamicProperties node.
- If the property you want to store is listed beneath this node, click the Ellipsis ( ) button next to it and do the following:
- Click Map property to a key in configuration file.
- If you want to change the value under which the property is stored, modify the setting of the Key field.
- If the property you want to store is not listed, click the Ellipsis ( ) button next to the Advanced property, and perform these steps in the dialog box that appears:
- In the Properties list box, select the check box next to the property whose value you want to store in an external file.
- 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.
- Click OK.
- Repeat step 4 or 5 for each property for which you want to store a value.
- 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.