This documentation is archived and is not being maintained.

IComponentChangeService.ComponentChanged Event

Occurs when a component has been changed.

[Visual Basic]
Event ComponentChanged As ComponentChangedEventHandler
[C#]
event ComponentChangedEventHandler ComponentChanged;
[C++]
__event ComponentChangedEventHandler* ComponentChanged;

[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.

Event Data

The event handler receives an argument of type ComponentChangedEventArgs containing data related to this event. The following ComponentChangedEventArgs properties provide information specific to this event.

Property Description
Component Gets the component that was modified.
Member Gets the member that has been changed.
NewValue Gets the new value of the changed member.
OldValue Gets the old value of the changed member.

Remarks

This event occurs when any component on the form changes. This event will not occur during form load and unload, because changes are expected at this time.

Tip   A DesignerTransaction can raise multiple ComponentChanged events. Some ComponentChanged event handlers can interfere with with expected sequences of events, such as if your code alters the values of properties while a transaction is occurring. A ComponentChanged event handler can also impair performance if it draws after each change while a DesignerTransaction is in progress. In order to allow a DesignerTransaction in process to complete without interruption or interference by your ComponentChanged event handler, you can test the state of the InTransaction property, and defer handling the change events until the completion of the transaction by adding a DesignerTransactionCloseEventHandler which will raise your ComponentChanged event handler and remove itself upon completion of the transaction.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IComponentChangeService Interface | IComponentChangeService Members | System.ComponentModel.Design Namespace | ComponentChanging | ComponentRename | ComponentChangedEventHandler

Show: