Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ComponentRenameEventArgs Class

Provides data for the ComponentRename event.

For a list of all members of this type, see ComponentRenameEventArgs Members.

System.Object
   System.EventArgs
      System.ComponentModel.Design.ComponentRenameEventArgs

[Visual Basic]
<ComVisible(True)>
Public Class ComponentRenameEventArgs
   Inherits EventArgs
[C#]
[ComVisible(true)]
public class ComponentRenameEventArgs : EventArgs
[C++]
[ComVisible(true)]
public __gc class ComponentRenameEventArgs : public EventArgs
[JScript]
public
   ComVisible(true)
class ComponentRenameEventArgs extends EventArgs

Thread Safety

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

Remarks

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.

Example

[Visual Basic, C#, C++] The following example demonstrates creating a ComponentRenameEventArgs.

[Visual Basic] 
' This example method creates a ComponentRenameEventArgs using the specified arguments.
' Typically, this type of event args is created by a design mode subsystem.  
Public Function CreateComponentRenameEventArgs(ByVal component As Object, ByVal oldName As String, ByVal newName As String) As ComponentRenameEventArgs
    Dim args As 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
End Function

[C#] 
// 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;
}

[C++] 
// This example method creates a ComponentRenameEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.
ComponentRenameEventArgs* CreateComponentRenameEventArgs(Object* component, String* oldName, String* 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 new ComponentRenameEventArgs(component, oldName, newName);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.ComponentModel.Design

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

Assembly: System (in System.dll)

See Also

ComponentRenameEventArgs Members | System.ComponentModel.Design Namespace | ComponentRename | ComponentRenameEventHandler

Show:
© 2015 Microsoft