Another rather simple msvc question

This is a discussion on Another rather simple msvc question within the Windows Programming forums, part of the Platform Specific Boards category; Hello Is it possible to add both a name (which is displayed in the CListBox) and a hidden data value ...

  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, 09:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-21-2005, 12:41 AM
  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, 04:00 PM

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