ComponentEventArgs 类

定义

public ref class ComponentEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class ComponentEventArgs : EventArgs
type ComponentEventArgs = class
    inherit EventArgs
Public Class ComponentEventArgs
Inherits EventArgs
继承
ComponentEventArgs
属性

示例

下面的示例演示如何创建ComponentEventArgsThe following example demonstrates creating a ComponentEventArgs.

public:
   // This example method creates a ComponentEventArgs using the specified argument.
   // Typically, this type of event args is created by a design mode subsystem.
   ComponentEventArgs^ CreateComponentEventArgs( IComponent^ component )
   {
      // The component that is related to the event:  args.Component
      return gcnew ComponentEventArgs( component );
   }
// This example method creates a ComponentEventArgs using the specified argument.
// Typically, this type of event args is created by a design mode subsystem.  
public ComponentEventArgs CreateComponentEventArgs(IComponent component)
{
    ComponentEventArgs args = new ComponentEventArgs(component);

    // The component that is related to the event:  args.Component

    return args;
}
' This example method creates a ComponentEventArgs using the specified argument.
' Typically, this type of event args is created by a design mode subsystem.  
Public Function CreateComponentEventArgs(ByVal component As IComponent) As ComponentEventArgs

    Dim args As New ComponentEventArgs(component)

    ' The component that is related to the event:  args.Component

    Return args
End Function

注解

ComponentEventArgs所有组件管理事件的根事件参数类。ComponentEventArgs is the root event arguments class for all component management events. 当您使用设计器添加或删除组件时, 将发生此类型的事件。This type of event occurs when you add or remove components using a designer.

构造函数

ComponentEventArgs(IComponent)

初始化 ComponentEventArgs 类的新实例。Initializes a new instance of the ComponentEventArgs class.

属性

Component

获取与该事件关联的组件。Gets the component associated with the event.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅