EventDescriptorCollection.GetEnumerator メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > EventDescriptorCollection.GetEnumerator メソッドの意味・解説 

EventDescriptorCollection.GetEnumerator メソッド

EventDescriptorCollection の列挙子を取得します

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

Public Function GetEnumerator As
 IEnumerator
Dim instance As EventDescriptorCollection
Dim returnValue As IEnumerator

returnValue = instance.GetEnumerator

戻り値
IEnumerator を実装している列挙子。

解説解説
使用例使用例

button1イベント列挙子を取得するコード例次に示します。この例では、列挙子を使用してコレクション内のイベントの名前を出力します。この例では、button1textBox1フォーム上でインスタンス化されていることが必要です。

Private Sub MyEnumerator()
    ' Creates a new collection, and assigns to it the events for button1.
    Dim events As EventDescriptorCollection
 = TypeDescriptor.GetEvents(button1)
    
    ' Creates an enumerator.
    Dim ie As IEnumerator = events.GetEnumerator()
    
    ' Prints the name of each event in the collection.
    Dim myEvent As Object
    While ie.MoveNext() = True
        myEvent = ie.Current
        textBox1.Text += myEvent.ToString() & ControlChars.Cr
    End While
End Sub 'MyEnumerator
private void MyEnumerator() {
    // Creates a new collection, and assigns to it the events for button1.
    EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);
 
    // Creates an enumerator.
    IEnumerator ie = events.GetEnumerator();
 
    // Prints the name of each event in the collection.
    Object myEvent;
    while(ie.MoveNext() == true) {
       myEvent = ie.Current;
       textBox1.Text += myEvent.ToString() + '\n';
    }
 }

private:
   void MyEnumerator()
   {
      // Creates a new collection, and assigns to it the events for
 button1.
      EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 );
      
      // Creates an enumerator.
      IEnumerator^ ie = events->GetEnumerator();
      
      // Prints the name of each event in the collection.
      Object^ myEvent;
      while ( ie->MoveNext() == true )
      {
         myEvent = ie->Current;
         textBox1->Text = String::Concat( textBox1->Text, myEvent, "\n"
 );
      }
   }
private void MyEnumerator()
{
    // Creates a new collection, and assigns to it the events for button1.
    EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);

    // Creates an enumerator.
    IEnumerator myEnumerator = events.GetEnumerator();

    // Prints the name of each event in the collection.
    Object myEvent;

    while (myEnumerator.MoveNext() == true)
 {
        myEvent = myEnumerator.get_Current();
        textBox1.set_Text(textBox1.get_Text() + myEvent.ToString() + '\n');
    }
} //MyEnumerator
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EventDescriptorCollection クラス
EventDescriptorCollection メンバ
System.ComponentModel 名前空間
EventDescriptor クラス
TypeDescriptor
IEnumerator



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

EventDescriptorCollection.GetEnumerator メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



EventDescriptorCollection.GetEnumerator メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS