次の方法で共有


ComponentEventArgs クラス

ComponentAddedComponentAddingComponentRemovedComponentRemoving の各イベントのデータを提供します。

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)

構文

'宣言
<ComVisibleAttribute(True)> _
Public Class ComponentEventArgs
    Inherits EventArgs
'使用
Dim instance As ComponentEventArgs
[ComVisibleAttribute(true)] 
public class ComponentEventArgs : EventArgs
[ComVisibleAttribute(true)] 
public ref class ComponentEventArgs : public EventArgs
/** @attribute ComVisibleAttribute(true) */ 
public class ComponentEventArgs extends EventArgs
ComVisibleAttribute(true) 
public class ComponentEventArgs extends EventArgs

解説

ComponentEventArgs は、コンポーネント管理イベントすべてのルートとなるイベント引数クラスです。この種のイベントは、デザイナを使用してコンポーネントを追加または削除したときに発生します。

注意

このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。

使用例

ComponentEventArgs を作成する例を次に示します。

' 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
// 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;
}
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;
} //CreateComponentEventArgs

継承階層

System.Object
   System.EventArgs
    System.ComponentModel.Design.ComponentEventArgs

スレッド セーフ

この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

ComponentEventArgs メンバ
System.ComponentModel.Design 名前空間
ComponentEventHandler
IComponentChangeService