ComponentRenameEventArgs Class


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Provides data for the ComponentRename event.

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


[HostProtectionAttribute(SecurityAction.LinkDemand, SharedState = true)]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
public class ComponentRenameEventArgs : EventArgs

System_CAPS_pubmethodComponentRenameEventArgs(Object, String, String)

Initializes a new instance of the ComponentRenameEventArgs class.


Gets the component that is being renamed.


Gets the name of the component after the rename event.


Gets the name of the component before the rename event.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

A ComponentRenameEventArgs provides data about a ComponentRename event.

A ComponentRenameEventArgs object provides the following information:

  • A Component property that references the component being renamed.

  • An OldName property that indicates the old name of the component.

  • A NewName property that indicates the new name of the component.

The following example demonstrates creating a ComponentRenameEventArgs.

// This example method creates a ComponentRenameEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.  
public ComponentRenameEventArgs CreateComponentRenameEventArgs(object component, string oldName, string newName)
    ComponentRenameEventArgs args = new ComponentRenameEventArgs(component, oldName, newName);

    // The component that was renamed:          args.Component
    // The previous name of the component:      args.OldName
    // The new name of the component:           args.NewName            

    return args;

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top