Private Function CheckForDups(ByVal Text As String) As Boolean
For Each Item As String In Listbox1.Items
If Item.ToLower = Text.ToLower Then Return False
Next Item
Return True
End Function
'Usage:
If CheckForDups(TextFromFile) = False Then Listbox1.Items.Add(TextFromFile)
'where TextFromFile is the variable of the item from the text file
[SIZE=2][COLOR=#0000ff]
If [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] listbox1.Items.Contains("sometext") [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff] Me[/COLOR][/SIZE][SIZE=2].listbox1.Items.Add("sometext")
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]