Better List Box Item Search

This is a discussion on Better List Box Item Search within the Windows Programming forums, part of the Platform Specific Boards category; Does anyone know a better search for a listbox than the one supplied by LB_FINDSTRING? Say if I have a ...

  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,831
    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, 09:44 PM
  2. multi-column list box item order
    By pan nudus in forum Windows Programming
    Replies: 4
    Last Post: 02-24-2006, 07:26 AM
  3. multi-column list box item order
    By pan nudus in forum C++ Programming
    Replies: 1
    Last Post: 02-23-2006, 12: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21