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


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

Count プロパティを使用して、button1 に関するプロパティの数をテキスト ボックスに出力するコード例を次に示します。この例は、フォーム上に button1 と textBox1 が作成されていることを前提としています。
Private Sub GetCount ' Creates a new collection and assigns it the attributes for button 1. Dim attributes As AttributeCollection attributes = TypeDescriptor.GetAttributes(button1) ' Prints the number of items in the collection. textBox1.Text = attributes.Count.ToString End Sub
private void GetCount() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection attributes; attributes = TypeDescriptor.GetAttributes(button1); // Prints the number of items in the collection. textBox1.Text = attributes.Count.ToString(); }
private: void GetCount() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection^ attributes; attributes = TypeDescriptor::GetAttributes( button1 ); // Prints the number of items in the collection. textBox1->Text = attributes->Count.ToString(); }
private void GetCount() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection attributes; attributes = TypeDescriptor.GetAttributes(button1); // Prints the number of items in the collection. textBox1.set_Text(((Int32)attributes.get_Count()).ToString()); } //GetCount
private function GetCount() { // Create a new collection and assign it the attributes for button1. var attributes : AttributeCollection; attributes = TypeDescriptor.GetAttributes(button1); // Print the number of items in the collection. textBox1.Text = attributes.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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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



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


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

- AttributeCollection.Countのページへのリンク