IComponentChangeService.OnComponentChanging Method

Announces to the component change service that a particular component is changing.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)

void OnComponentChanging(
	Object component,
	MemberDescriptor member


Type: System.Object

The component that is about to change.

Type: System.ComponentModel.MemberDescriptor

The member that is changing. This is null if this change is not related to a single member.

This method raises the ComponentChanging event.

Most designers included with the Windows Software Development Kit (SDK), as well as the Visual Studio design-time environment, typically raise this event automatically; 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.

Notes to Implementers

This method throws an exception if the property cannot be changed. This is not intended to validate the values of a particular property. Instead, it is intended to provide a global method of preventing a component from changing. For example, if a designer file is checked into source code control, this event's handler would typically throw an exception if the user refused to check out the file.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft