PropertyDescriptorCollection.Count プロパティ
アセンブリ: System (system.dll 内)

コレクション内のプロパティ記述子の数。

Count プロパティを使用して、オブジェクトのコレクションを反復処理するループの上限を設定できます。コレクションのインデックスは 0 から始まるため、ループの上限として Count - 1 を使用します。

Count プロパティを使用して、button1 に関するプロパティの数を出力するコード例を次に示します。この例では、button1 と textBox1 がフォーム上でインスタンス化されていることが必要です。
Private Sub GetCount() ' Creates a new collection and assign it the properties for button1. Dim properties As PropertyDescriptorCollection = TypeDescriptor.GetProperties(button1) ' Prints the number of properties on button1 in a textbox. textBox1.Text = properties.Count.ToString() End Sub
private void GetCount() { // Creates a new collection and assign it the properties for button1. PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1); // Prints the number of properties on button1 in a textbox. textBox1.Text = properties.Count.ToString(); }
private: void GetCount() { // Creates a new collection and assign it the properties for button1. PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1 ); // Prints the number of properties on button1 in a textbox. textBox1->Text = properties->Count.ToString(); }
private void GetCount() { // Creates a new collection and assign it the properties for button1. PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1); // Prints the number of properties on button1 in a textbox. textBox1.set_Text(System.Convert.ToString(properties.get_Count())); } //GetCount

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に収録されているすべての辞書からPropertyDescriptorCollection.Count プロパティを検索する場合は、下記のリンクをクリックしてください。

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