Advertisement
C_Volume2 Miscellaneous #72306

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

สรุปโดย 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.

ซอร์สโค้ด
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
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine