Export (0) Print
Expand All

Removing Keys from Properties

Visual Studio .NET 2003

You remove a key from a property when you no longer want to store that property's value in an external file. Removing a key removes the code indicating that the property value is stored in a configuration file.

Note that the system does not automatically update the configuration file when you remove a key from a property — the entry still appears in the configuration file. This is because the configuration file does not keep track of references to a key; because multiple properties may use the same key, the configuration file has no way of knowing when a key is no longer in use. Therefore, there may be many more keys in your configuration file than are actually in use in the product. This should not cause problems for your application.

To remove a key from a property

  1. Access the Properties window for the form, control, or component.
  2. Expand the DynamicProperties node. All properties that currently have keys are listed beneath this section.
  3. Locate the property whose key you want to remove, then click the Ellipsis ( 6dd7sw5w.vbellipsesbutton(en-us,VS.71).gif ) button next to it.
  4. In the dialog box that appears, uncheck the Map property to a key in configuration file check box.

    When you return to the Properties window, that property will now show a value of None in the DynamicProperties node, indicating that its value is no longer being stored.

    Note   If you want, you can edit the configuration file to remove the entry for this property; however, leaving the property key in the file will not cause any errors in your application.

See Also

Introduction to Dynamic Properties | Setting Dynamic Properties | Changing the Value of Dynamic Properties | Walkthrough: Storing and Retrieving Dynamic Properties

© 2015 Microsoft