AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile
Hi, my program adds entries in a ComboBox. I woud like to avoid to insert the same entry (actually IPAddresses) twice by checking if this entry already exist in the COmbobox before inserting it. How could Ido this with VB5 ? Thank you
may this help
Him thanks I fixed it with (nbitem2 is the number of entries in the combo box) , works great : 'avoid duplicates in the combo list testIP = 1 check = 0 Do While testIP <= nbitem2 If Combo1.List(testIP) = hostIP Then check = 1 End If testIP = testIP + 1 Loop If check = 0 Then Combo1.AddItem (hostIP) nbitem2 = nbitem2 + 1 End If Thank you anyway!