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
ملخص الذكاء الاصطناعي: 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.
كود المصدر
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
التعليقات الأصلية (3)
مسترجع من Wayback Machine