Hi,
I am getting an exception when trying to run the below code in vb.net 2005
Public Class Form1
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As String) As Long
Public Const LB_FINDSTRING = &H18F
Dim listBoxHandle As IntPtr
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
listBoxHandle = ListBox1.Handle
ListBox1.SelectedIndex = SendMessage(listBoxHandle, LB_FINDSTRING, -1, Int(TextBox1.Text))
End Sub
End Class