I have found two ways to search a listbox for a string.

First way is to use api:
VB Code:
  1. Option Explicit
  2. Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  3.  
  4. 'Searchs a listbox for a matching string. Returns the listindex of the matching item.
  5.  
  6. Function ListboxFindString(strSearchString As String, lHwndListbox As Long) As Long
  7.     Const LB_FINDSTRING = &H18F
  8.     ListboxFindString = SendMessage(lHwndListbox , LB_FINDSTRING, -1, ByVal strSearchString)
  9. End Function

and the second, the vb.net built-in function:
VB Code:
  1. Dim i As Integer = ListBox1.FindString("String To Find")

Even tho the second one is much smaller, which one from those is the fastest? Anyone Know?