ListItemCollection.Count Propriedade
Definição
public:
property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
Valor da propriedade
O número de objetos ListItem na coleção.The number of ListItem objects in the collection.
Implementações
Exemplos
Para exibir o código a seguir em um exemplo totalmente funcional, consulte o ListItemCollection tópico classe.To view the following code in a fully working example, see the ListItemCollection class topic.
// Set the number of rows displayed in the ListBox to be
// the number of items in the ListBoxCollection.
ListBox1.Rows = ListBox1.Items.Count;
' Set the number of rows displayed in the ListBox to be
' the number of items in the ListBoxCollection.
ListBox1.Rows = ListBox1.Items.Count
Comentários
Use a Count propriedade para determinar o número de ListItem objetos no ListItemCollection .Use the Count property to determine the number of ListItem objects in the ListItemCollection. A Count propriedade é comumente usada ao iterar pela coleção para determinar o limite superior da coleção.The Count property is commonly used when iterating through the collection to determine the upper bound of the collection.