Thread: List Box question

  1. #1
    TravisS
    Guest

    Question List Box question

    I would like to know how to clear a list box. I've done a search here, looked at a ton of websites (including Ken's), and looked through the "mini" MSDN that came with my C++ for dummies

    Basically, in the begining of the program it loads up a list of names. OK, great. Now, that list is going to change when the user either adds , deletes, or modifies an entry. If it's possible, I would like to clear the entire list box, then reload it with the new data. I realize it would be more effecient to just remove (or add) that one item, but that's not the way I want to do it.

    Can anybody help me out?

  2. #2
    TravisS
    Guest
    Oh, and if you think a list box isn't the best way to go about it, that's fine too. It's more important to me that I can clear the old text than it is to be able to have the user click their choice.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    SendMessage() with a LB_RESETCONTENT should clear it.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    TravisS
    Guest
    Sweet, thank you so much

    It seems so simple, I don't know why I couldn't find it earlier.

  5. #5
    TravisS
    Guest
    Heh, should have mentioned that it was in a dialog box. Just had to use SendDlgItemMessage() instead

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting linked list please help with CODE
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 09-27-2008, 11:24 PM
  2. List Question
    By ConsulVortex in forum C++ Programming
    Replies: 3
    Last Post: 01-14-2006, 04:38 AM
  3. Problem with linked list ADT and incomplete structure
    By prawntoast in forum C Programming
    Replies: 1
    Last Post: 04-30-2005, 01:29 AM
  4. 1st Class LIST ADT
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 07:29 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM