Thread: Another rather simple msvc question

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    291

    Another rather simple msvc question

    Hello

    Is it possible to add both a name (which is displayed in the CListBox) and a hidden data value to a CListBox ? This hidden data value could be a id number that I dont want the user to see.
    If possible, how would the code look ?

    Also, if a user click on a item in the list how can I retrive this data and place it into a i.e. CString variable ?

    Appreciate any response.

    Thanks.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is the LPARAM element of LITEM structure.

    SetItemData()
    GetItemData()

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple question regarding variables
    By Flakster in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2005, 08:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  3. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM