Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Visual Basic Concepts

Visual Studio 6.0

Deleting Application Settings

You can use the DeleteSetting statement to delete a registry key, section, or an application's registry location. For example, you may want to delete all registry information for an application when the application is uninstalled.

Use the following syntax for the DeleteSetting statement:

DeleteSetting(appname, section, key)

The following code deletes the LastEntry key in the "RegCust" application's Startup section.

Private Sub cmdDelKey_Click()
   DeleteSetting "RegCust", "StartUp", "LastEntry"
End Sub

The following code deletes the "RegCust" application's entire Startup section of the registry.

Private Sub cmdDelSection_Click()
   DeleteSetting "RegCust", "StartUp"
End Sub

The following code deletes the entire registry location for the "RegCust" application.

Private Sub cmdUnInstall_Click()
   DeleteSetting "RegCust"
End Sub

For More Information   See "DeleteSetting Statement."

Show:
© 2015 Microsoft