Many of the .NET Framework objects support dynamic properties. Dynamic properties provide a way to change property values without recompiling an application. The dynamic properties and their values are stored in a configuration file, along with the application's executable file. Changing a property value in the configuration file causes the change to take effect the next time the applications runs. Dynamic properties are useful for changing an application after it has been deployed.
To set a dynamic property in the Object Inspector
- In a form on the Design tab, click the object for which you want to set dynamic properties.
- In the Object Inspector, expand (DynamicProperties) and click (Advanced). If the object does not support dynamic properties, (DynamicProperties) is not displayed.
Tip: If the Object Inspector
is arranged by category, (DynamicProperties) is displayed under Configurations.
- Click the ellipsis (...) button next to (Advanced) to display the Dynamic Properties dialog box. This dialog lists all of the properties that can be stored in the configuration file.
- Select the properties you want to store in the configuration file.
- Optionally, you can override the default key name listed in the Key mapping field.
- Click OK. The dynamic properties are marked with an icon in the Object Inspector. RAD Studio creates an XML file named app.config (for a Windows application) or Web.config (for a Web application) in the project directory. This file lists the dynamic properties and their current values.
- Compile the application. RAD Studio creates a file named <projectname>.exe.config (for a Windows application) or <projectname>.dll.config (for a Web application) in the same directory as the application's executable or DLL file.
To change a dynamic property value in the configuration file
- In the directory that contains the application's executable or DLL file, locate the configuration file.
- Open the file in a text editor.
- Locate the add key= statement for the property to be changed and edit the value.
- Save your changes and close the file.
The next time the application runs, the changed property value will be in effect.