OnComponentChanged Method
Collapse the table of content
Expand the table of content

IComponentChangeService.OnComponentChanged Method

Announces to the component change service that a particular component has changed.

[Visual Basic]
Sub OnComponentChanged( _
   ByVal component As Object, _
   ByVal member As MemberDescriptor, _
   ByVal oldValue As Object, _
   ByVal newValue As Object _
void OnComponentChanged(
   object component,
 MemberDescriptor member,
 object oldValue,
 object newValue
void OnComponentChanged(
   Object* component,
 MemberDescriptor* member,
 Object* oldValue,
 Object* newValue
function OnComponentChanged(
   component : Object,
 member : MemberDescriptor,
 oldValue : Object,
 newValue : Object


The component that has changed.
The member that has changed. This is a null reference (Nothing in Visual Basic) if this change is not related to a single member.
The old value of the member. This is valid only if the member is not a null reference (Nothing in Visual Basic).
The new value of the member. This is valid only if the member is not a null reference (Nothing in Visual Basic).


This method raises the ComponentChanged event.

Most designers that ship with the .NET Framework SDK, as well as the Visual Studio .NET design-time environment, typically raise this event for you when a component in a project is changed, so most of the time you do not need to explicitly call this method. The appropriate IComponentChangeService events are automatically raised when a PropertyDescriptor is used to change a property value or components are added or removed from the IDesignerHost container.

Before calling OnComponentChanged, first call OnComponentChanging to indicate that a component is about to change, and make the change. Then call OnComponentChanged to raise the ComponentChanged event.

Notes to Implementers:  This event allows the implementer to do any post-processing that is needed after a property change. For example, a designer typically updates the source code that sets the property with the new value.


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 | MemberDescriptor

© 2016 Microsoft