Private Sub Form_Load()
List1.AddItem "Item #1"
List1.AddItem "Item #2"
List1.AddItem "Item #3"
List1.AddItem "Item #4"
End Sub
Private Sub Command1_Click()
CheckForDupes
End Sub
Sub CheckForDupes()
Dim Ret As Long
Dim A As String
A = Text1.TEXT
Ret = SendMessageFind(List1.hwnd, LB_FINDSTRING, 0, (A))
If Ret = LB_ERR Then
List1.AddItem Text1.TEXT
Else
List1.ListIndex = Ret
MsgBox "Finns redan- kan inte addera till Listboxen.", 16, "Error"
End If
End Sub