Advertisement
2002C Miscellaneous #12724

Add only unique items to a listbox (no duplicates added). Fast and short without any loops.

Use this method to avoid adding an item to a ListBox that already exists. It's a lot faster and shorter than submissions that uses loops etc.

AI

Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kaynak Kod
original-source
Private Sub AddUnique(StringToAdd As String, lst As ListBox)
  lst.Text = StringToAdd
  If lst.ListIndex = -1 Then
    'it does not exist, so add it..
    lst.AddItem StringToAdd
  End If
End Sub
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı