Deletes a section or key setting from the Windows Registry entry.
DeleteSetting(appname, section[, key])
The DeleteSetting statement syntax has these named arguments:
Part | Description |
appname | String expression containing the name of the application or project to which the section or key setting applies. |
section | String expression containing the name of the section where the key setting is being deleted. If only appname and section are provided, the specified section is deleted along with all related key settings. |
key | String expression containing the name of the key setting being deleted. |
If all arguments are provided, the specified key setting is deleted. However, the DeleteSetting statement does nothing if the specified section or key setting does not exist.
GetAllSettings Function, GetSetting Function, SaveSetting Statement.
The following example first uses the SaveSetting statement to make entries in the Windows Registry (or .ini file on 16-bit Windows platforms) for the MyApp application, then uses the DeleteSetting statement to remove them. Because no key is specified, the whole section is deleted, including the section name and all its keys.
' Place some settings in the registry.(appname := "MyApp", section := "Startup", _ key := "Top", setting := 75)("MyApp","Startup", "Left", 50) ' Remove section and all its settings from registry.("MyApp", "Startup")