LISTBOX NO DUPLICATES IN LIST - VB6 Source Code
HOW TO ADD ITEMS TO LISTBOX IN VB6 WITH NO DUPLICATES, NO CODE LOOPS ...
Home
Short:
Function bfuncNoDuplicate(ByVal lst As ListBox, StringToAdd As String, Optional bAddItem As Boolean = True) As Boolean on error goto err: With lst ' remember currently selected list item Dim iSel As Integer: iSel = .ListIndex .Text = StringToAdd If .ListIndex = -1 Then ' it does not exist, so add it.. If bAddItem Then .AddItem StringToAdd bfuncNoDuplicate = True Else ' select the listindex that was already selected before call to this function If iSel >= 0 Then lst.ListIndex = iSel End If End With exit function err: with err if .number <> 0 then end if end with End Function
source code home
S
H
A
R
E
Facebook
Twitter
LinkdIn
Reddit
Blogger
π Ώing
Email π§
π Multiple
Facebook
Twitter
Linkdin
Reddit
Blogger
Ping
Email
Share β