EventDescriptorCollection.Count プロパティ
名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文

Count プロパティは、オブジェクトのコレクションを反復処理するループの限度を設定するために使用できます。コレクションのインデックスが 0 から始まる場合は、ループの上限として Count - 1 を使用します。
![]() |
---|
このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、Synchronization です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

Count プロパティを使用して、button1 に関連付けられたイベントの数を出力するコード例を次に示します。この例では、button1 と textBox1 がフォーム上でインスタンス化されていることが必要です。
Private Sub GetCount() ' Creates a new collection and assigns it the events for button1. Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1) ' Prints the number of events on button1 in a text box. textBox1.Text = events.Count.ToString() End Sub 'GetCount
private void GetCount() { // Creates a new collection and assigns it the events for button1. EventDescriptorCollection events = TypeDescriptor.GetEvents(button1); // Prints the number of events on button1 in a text box. textBox1.Text = events.Count.ToString(); }

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.Count プロパティを検索する場合は、下記のリンクをクリックしてください。

- EventDescriptorCollection.Count プロパティのページへのリンク