|
-
Nov 27th, 2000, 12:29 PM
#1
i have a text box and a list box, as i type in the text box, it scrolls to the specific letter in the list box.
when the letter is found, i set the focus to the list box. how can i do something like, i keep typing in the text box and the up and down arrow keys also work in the list box.
presently i've trapped the keyup event of list box.
thanx
-
Nov 27th, 2000, 12:57 PM
#2
PowerPoster
Why not use a combo box?? Set the the matching property to style 2
-
Nov 27th, 2000, 01:31 PM
#3
there's no matching property in combo box, what setting i've to make in combo box, to make it look like a list box, something like the help interface
-
Nov 27th, 2000, 03:24 PM
#4
Try this:
Code:
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
Const LB_FINDSTRING = &H18F
Private Sub Text1_Change()
List1.ListIndex = SendMessage(List1.hWnd, _
LB_FINDSTRING, -1, ByVal Text1.Text)
End Sub
If you'd prefer to find the item as you type it in and move it to the top of the list:
Code:
Private Sub Text1_Change()
On Error Resume Next
List1.ListIndex = SendMessage(List1.hwnd, _
LB_FINDSTRING, -1, ByVal Text1.Text)
List1.TopIndex = List1.ListIndex - 1
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|