ListItemCollection.Count Propiedad

Definición

Obtiene el número de objetos ListItem que hay en la colección.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Valor de propiedad

El número de objetos ListItem de la colección.

Implementaciones

Ejemplos

Para ver el código siguiente en un ejemplo de trabajo completo, consulte el tema de la ListItemCollection clase .

// 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

Comentarios

Utilice la Count propiedad para determinar el número de objetos de ListItem .ListItemCollection La Count propiedad se usa normalmente al recorrer en iteración la colección para determinar el límite superior de la colección.

Se aplica a

Consulte también