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
Podsumowanie AI: 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.
Kod źródłowy
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
Oryginalne komentarze (3)
Odzyskane z Wayback Machine