HOWTO: Search a ListBox Control QuicklyLast reviewed: July 15, 1997Article ID: Q161161 |
The information in this article applies to:
SUMMARYA popular item in a user interface is to "link" a text box to a list box so the nearest match in the list box is selected when the user types text into the text box. This technique can be implemented using pure Visual Basic code, but the Windows API provides a quicker and easier way to do this.
MORE INFORMATIONThe technique calls the Windows API SendMessage function using the LB_FINDSTRING message for a list box to locate a partial match for a string in the list box. SendMessage requires the following parameters:
SendMessage(hWnd, LB_FINDSTRING, wParam, lParam) where hWnd - is the hWnd of the list box. wParam - is an integer that specifies the starting point for the search. Use -1 to search the whole list box. lParam - is a long pointer to the string to find. Step-by-Step Example
Keywords : vb5all vb5howto VBKBCtrl VBKBInt VBKBListBox VBKBStd kbprg kbhowto Version : 5.0 Platform : WINDOWS Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |