From: "Bill Brehm" don't want on
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.

Bill


From: "Bill Brehm" don't want on
When an item is hidden it should make the row height to zero, not just blank
out the row. In fact, if it were possible to set the row height to zero that
would serve my purpose. I could already blank the row by returning "" in the
callback but that wouldn't look nice or suit my purpose.

"Bill Brehm" <don't want spam> wrote in message
news:OFHl1RfrIHA.4544(a)TK2MSFTNGP04.phx.gbl...
> 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.
>
> Bill
>


From: David Webber on

"Bill Brehm" <don't want spam> wrote in message
news:OFHl1RfrIHA.4544(a)TK2MSFTNGP04.phx.gbl...

> 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


From: "Bill Brehm" don't want on
Dave,

Your idea was my plan B. Problem is I have a lot of items in my list so
deleting everything out and re-adding everything takes quite some time.
That's why I was looking for a plan A. Are you saying I guess that there is
no way to hide items or size a row?

Is there a way to edit in place?

Thanks,

Bill


"David Webber" <dave(a)musical-dot-demon-dot-co.uk> wrote in message
news:eJ9gLqgrIHA.5096(a)TK2MSFTNGP02.phx.gbl...
>
> "Bill Brehm" <don't want spam> wrote in message
> news:OFHl1RfrIHA.4544(a)TK2MSFTNGP04.phx.gbl...
>
>> 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
>
>


From: Joseph M. Newcomer on
You can't show/hide elements of a CListBox or CListCtrl. Note that making the size 0 will
just confuse the user who might be using arrow keys to move up and down.

Look into virtual listboxes or virtual list controls. You don't need to keep re-adding
everything
joe

On Mon, 5 May 2008 07:28:29 +0800, "Bill Brehm" <don't want spam> wrote:

>Dave,
>
>Your idea was my plan B. Problem is I have a lot of items in my list so
>deleting everything out and re-adding everything takes quite some time.
>That's why I was looking for a plan A. Are you saying I guess that there is
>no way to hide items or size a row?
>
>Is there a way to edit in place?
>
>Thanks,
>
>Bill
>
>
>"David Webber" <dave(a)musical-dot-demon-dot-co.uk> wrote in message
>news:eJ9gLqgrIHA.5096(a)TK2MSFTNGP02.phx.gbl...
>>
>> "Bill Brehm" <don't want spam> wrote in message
>> news:OFHl1RfrIHA.4544(a)TK2MSFTNGP04.phx.gbl...
>>
>>> 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
>>
>>
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm