ApplicationSettingsBase.SettingChanging Event

Note: This event is new in the .NET Framework version 2.0.

Occurs before the value of an application settings property is changed.

Namespace: System.Configuration
Assembly: System (in system.dll)

Public Event SettingChanging As SettingChangingEventHandler
Dim instance As ApplicationSettingsBase
Dim handler As SettingChangingEventHandler

AddHandler instance.SettingChanging, handler

/** @event */
public void add_SettingChanging (SettingChangingEventHandler value)

/** @event */
public void remove_SettingChanging (SettingChangingEventHandler value)

JScript supports the use of events, but not the declaration of new ones.

The SettingChanging event occurs before an application setting value property is changed through the Item method. This event is not raised when the Reload or Reset methods are called. SettingChanging can be canceled through the SettingChangingEventArgs event data class.

You typically use the SettingChanging event to handle immediate validation of an individual settings property. For more information about validation, see How to: Validate Application Settings.

There is no corresponding SettingChanged event for this class; instead, see the PropertyChanged event.

The following code example shows the SettingChanging event handler for object of type FormSettings, which is a wrapper class derived from ApplicationSettingsBase. The handler displays the event information in a textbox named tbStatus. The full code example is listed in the ApplicationSettingsBase class overview.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions