Thread: Better List Box Item Search

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    112

    Better List Box Item Search

    Does anyone know a better search for a listbox than the one supplied by LB_FINDSTRING?

    Say if I have a list box with the following items:
    MyNameIsSam
    Samson
    CarlAndSamsell
    CarlAndSamseon

    and you search "Samsel" it would come up with the third( 2nd by index value) item in the list. I'm probably going to program my own search but I'm just seeing if anyone else has one like this before I start.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    LB_FINDSTRINGEXACT

    you can also use LB_FINDSTRINGEXACT
    zMan

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    112
    That's even wose, I need something way more general. I'm just wondering if anyone has even wrote a function to do what I described above.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    The problem with LB_FINDSTRING is that it always starts comparing from the front of the listbox item string, so "Sam" would find a match, but "Samsel" would not. I am not aware of another LB_function which does what you want.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  2. multi-column list box item order
    By pan nudus in forum Windows Programming
    Replies: 4
    Last Post: 02-24-2006, 08:26 AM
  3. multi-column list box item order
    By pan nudus in forum C++ Programming
    Replies: 1
    Last Post: 02-23-2006, 01:52 AM
  4. Big help in Astar search code...
    By alvifarooq in forum C++ Programming
    Replies: 6
    Last Post: 09-24-2004, 11:38 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM