Listbox find text with key

hello, someone could tell me what code to use for a listbox (volume browser) accept quest for lyrics keystrokes on the keyboard to find one lyrics into list?

thank you!

Have a look in this thread for the use of Regex: https://forum.xojo.com/3654-incremental-search-in-a-list-box/p1#p25354

Let me rephase the question:

How do I found an entry in the ListBox ?

Simple:
take the Row Count as loop max value,
compare each row with the search string
exit when find

HTH

I just read the regex example: an elephant gun to kill a fly ?

the code I used is:

For LoopIdx = 0 To LBCnt
FoundRow = InStr(LB.Cell(LoopIdx,0),TFSearch.Text)
If FoundRow > 0 Then Exit
Next

Of course, you have to check if the MListBox and TFSearch are not empty, get the number of Rows (LBCnt), declare LoopIdx as Integer, etc.

But once you have the FoundRow, you can report the Row #, One Cell from that Row or the whole Row.

8 lines of Regex code can one hardly call an elephant gun?

Mmm… I see that the Instr() function performs the same as the Regex… you are right…:slight_smile:

Yes, but RegEx offers far more flexibillity regarding the searchpattern :wink:

Thanks for everyone’s help, I appreciate!

elephant gun
Yes, sometimes I speak a little louder than needed ;:slight_smile: