Thread: MFC: Using CListCtrl as a Check List?

  1. #1
    Registered User
    Join Date
    Apr 2003

    Question MFC: Using CListCtrl as a Check List?


    I am revising on the basics of MFC and in this program I would like to have some sort of "checklist".

    The "checklist" will have multiple columns of data and based on previous inputs, the some of the rows(row considered as single item) should be selected by default. The data(strings) in the "checklist" are not static data. (Each items have multiple attributes to be organised into columns and the items are selectable.)

    Currently I am using CListCtrl report form as the "checklist" and during initialisation, I insert the items, the text and set certain items' state to be selected.

    I would like to allow the user to do additional item selection or deselecting some of the automated selection.

    However, for CListCtrl, to add/remove selection, the user have to hold down the CTRL key. (If user just click an item without holding the CTRL key, only the lastest item will be selected and all others will be deselected.)

    Is there anyway to make the selecting such that the a single left click on an item will change the its selection state?

    Or are there any better ways for me to implement this "checklist"? (The ideal one will be one in table form with columns, column headers, and a column with a "checkbox" to do the selection.)

    I am using MFC Application Dialog Based.

    Thanks in advanced.

  2. #2
    Registered User
    Join Date
    Jan 2007
    CListCtrl default functionality will reset item selection unless you hold down Ctrl. Manually Update the state of all selected items.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help! Placement of nodes in a Linked List
    By lostmyshadow in forum C Programming
    Replies: 6
    Last Post: 12-17-2007, 01:21 PM
  2. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  3. How can I traverse a huffman tree
    By carrja99 in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2003, 05:46 PM
  4. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 09:27 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM