Dim ItemToAdd As String = "Lucky Item"
Dim Count As Integer = 0
For i As Integer = 1 To 25
If Count >= 10 Then
MsgBox("Yay ! 10 same items in the list.")
'You can also uncomment the following line so that the counter resets after every 10 items.
'Count = 0
End If
ListBox1.Items.Add(i.ToString())
Count += 1
Next
Dim ItemToCheck As String = "Lucky Item"
Dim Count As Integer = 0
For Each Item As String In ListBox1.Items
If Item = ItemToCheck Then
Count += 1
End If
If Count >= 10 Then
MsgBox("Yay ! Found the item. It was found in the list for " + Count.ToString() + " times.")
'Count = 0
End If
Next