Bagikan melalui


ListItemCollection.Count Properti

Definisi

Mendapatkan jumlah ListItem objek dalam koleksi.

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

Nilai Properti

Jumlah ListItem objek dalam koleksi.

Penerapan

Contoh

Untuk melihat kode berikut dalam contoh yang berfungsi penuh, lihat ListItemCollection topik kelas.

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

Keterangan

Count Gunakan properti untuk menentukan jumlah ListItem objek dalam ListItemCollection. Properti Count umumnya digunakan saat melakukan iterasi melalui koleksi untuk menentukan batas atas koleksi.

Berlaku untuk

Lihat juga