I have a text box that is used to select items from a listbox. I have the code so that as you type letters into the text box it automatically moves the selection around in the list box to find the item that matches what you have typed in so far. However, I also want it to fill in the text box with the remainder of whatever is highlighed in the listbox. I want it to perform the same way as Netscape Communicator does when you begin to type in a URL that you have already been to. I've got the code so that it will fill it in the first time it finds a match in the listbox, but if you type another letter, the whole thing disappears and nothing fills it's place. Any suggestions as to why? Here is my code:
Hope you can shed some light on the subject.Code:General Declarations: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const LB_FINDSTRING = &H18F Private Sub txtViewTable_Change() Dim x As String x = Len(txtViewTable.Text) listTables.ListIndex = SendMessage(listTables.hWnd, LB_FINDSTRING, -1, ByVal txtViewTable.Text) txtViewTable.SelStart = x txtViewTable.SelLength = Len(txtViewTable.Text) - x End Sub
------------------
Ryan
[email protected]
ICQ# 47799046
[This message has been edited by Gimpster (edited 12-28-1999).]




Reply With Quote