Auto select in listbox when user types in textbox
- From: Sheldon <Sheldon@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 2 Apr 2008 14:44:03 -0700
Help!
I used to user the following code in VB6 to scroll the listbox in response
to a user typing in text:
In a module:
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_SELECTSTRING = &H18C
In a form:
Private Sub txtLstAll_Change()
If txtLstAll.Text <> "" Then
SendMessage lstAll.hwnd, LB_SELECTSTRING, -1, txtLstAll.Text
End If
End Sub
I tried this in the NEW IMPROVED Visual Studio 2008, using vb and I am
getting the following error message:
'hwnd' is not a member of 'System.Windows.Forms.ListBox'.
Does anyone know if there Is there a way of doing this in 2008? ANY help or
if you could point me in the right direction to find something would really
be appreciated!
--
Sheldon
.
- Follow-Ups:
- Re: Auto select in listbox when user types in textbox
- From: Jeff Gaines
- Re: Auto select in listbox when user types in textbox
- Prev by Date: diagram
- Next by Date: How to print only certain page(s) in Microsoft Reports rdlc
- Previous by thread: diagram
- Next by thread: Re: Auto select in listbox when user types in textbox
- Index(es):
Relevant Pages
|