Re: CListCtrl, hide and edit




"Bill Brehm" <don't want spam> wrote in message news:OFHl1RfrIHA.4544@xxxxxxxxxxxxxxxxxxxxxxx

MFC 6.0. The Help implied that I can hide an item in a CListCtrl. But I can't find out how to do it. I'd like to be able to fill a CListCtrl with a set of data, then filter to show only a subset by hiding all those items not in the subset.

Also, GetEditControl() implies (to me at least) that I can get a CEdit pointer edit an item (or subitem?) in a CListCtrl. But I can't see how to specify the item or subitem to be edited. I have a different CListCtrl with a number of items that I would like to edit in place to allow the user to configure something.

Thanks for any suggestions.

In circumstances like this I

- derive my own class from CListBox
- store in it a collection of ALL objects which can be selected (usually in a vector)
- add to the list box only those which need to be seen.
- in particular I put the text I want to show in the list item, and store a pointer to the corresponding object as the list item's data.

When the set of objects I want to show changes, I

- empty everything out of the list,
- add the new set of objects I want to show in the same way.

HTH

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm


.



Relevant Pages

  • Re: CListCtrl, hide and edit
    ... You can't show/hide elements of a CListBox or CListCtrl. ... pointer edit an item in a CListCtrl. ... in particular I put the text I want to show in the list item, and store ...
    (microsoft.public.vc.mfc)
  • How to Identify the Item and Subitem that has been Clicked in a CListCtrl
    ... I am trying to identify the row and column in a CListCtrl when the user ... signature will have an LPNMITEMACTIVATE struct pointer that will contain the ... item and subitem that has been clicked on. ...
    (microsoft.public.vc.mfc)
  • Re: How to add subitem images in CListCtrl?
    ... "Tony Thomas" wrote in message ... > is it possible to display an image from a CImageList ... > beneath a SubItem of a CListCtrl? ...
    (microsoft.public.vc.mfc)
  • Re: How to set images for CListCtrl subutems?
    ... "Tony Thomas" wrote in message ... > is it possible to display an image from a CImageList ... > beneath a SubItem of a CListCtrl? ...
    (microsoft.public.vc.language)
  • Re: CListView Insert and sorting
    ... Nevermind, I got this one. ... > When I insert items into my clistctrl, I also insert a subitem. ...
    (microsoft.public.vc.mfc)

Loading