Question |
How do I search my listbox for a particular string? |
Answer |
There are three control messages you can use with list boxes that will allow you to search for
strings and/or select them. These messages are: int index = ListBox1->Perform(LB_FINDSTRING,-1,(LPARAM)Edit1->Text.c_str()); if (index != -1) ListBox1->ItemIndex = index; or: int index = ListBox1->Perform(LB_SELECTSTRING,-1,(LPARAM)Edit1->Text.c_str()); //this one will automatically select the string if it is found. |
Last Modified: 12-JAN-01