EventDescriptorCollection.Find メソッド
アセンブリ: System (system.dll 内)

Dim instance As EventDescriptorCollection Dim name As String Dim ignoreCase As Boolean Dim returnValue As EventDescriptor returnValue = instance.Find(name, ignoreCase)
戻り値
指定した名前の EventDescriptor。イベントが存在しない場合は null 参照 (Visual Basic では Nothing)。

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

特定の EventDescriptor を検索するコード例を次に示します。見つかった EventDescriptor のコンポーネントの型をテキスト ボックスに出力します。この例では、button1 と textBox1 がフォーム上でインスタンス化されていることが必要です。
Private Sub FindEvent() ' Creates a new collection and assigns it the events for button1. Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1) ' Sets an EventDescriptor to the specific event. Dim myEvent As EventDescriptor = events.Find("Resize", False) ' Prints the event name and event description. textBox1.Text = myEvent.Name & ": " & myEvent.Description End Sub 'FindEvent
private void FindEvent() { // Creates a new collection and assigns it the events for button1. EventDescriptorCollection events = TypeDescriptor.GetEvents(button1); // Sets an EventDescriptor to the specific event. EventDescriptor myEvent = events.Find("Resize", false); // Prints the event name and event description. textBox1.Text = myEvent.Name + ": " + myEvent.Description; }
private: void FindEvent() { // Creates a new collection and assigns it the events for button1. EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 ); // Sets an EventDescriptor to the specific event. EventDescriptor^ myEvent = events->Find( "Resize", false ); // Prints the event name and event description. textBox1->Text = String::Concat( myEvent->Name, ": ", myEvent->Description ); }
private void FindEvent() { // Creates a new collection and assigns it the events for button1. EventDescriptorCollection events = TypeDescriptor.GetEvents(button1); // Sets an EventDescriptor to the specific event. EventDescriptor myEvent = events.Find("Resize", false); // Prints the event name and event description. textBox1.set_Text(myEvent.get_Name() + ": " + myEvent.get_Description()); } //FindEvent

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からEventDescriptorCollection.Find メソッドを検索する場合は、下記のリンクをクリックしてください。

- EventDescriptorCollection.Find メソッドのページへのリンク