Ririko Horvath wrote:
> Is there a way to disable an item in CListCtrl so that the item is gray
> out and a user won't be able to select it.
You will have to derive from CListCtrl and override DrawItem. There is
an example of what this entails in the CListBox::DrawItem. There are
examples all over the web for CListCtrl. You will have to keep track of
what is enabled yourself, you can use the data member of the item.
You will want to handle LVN_ITEMCHANGING. If you have disabled it, set
*pResult to 1. This will keep the item from changing to selected. This,
even if you don't draw it selected, so the selected flag doesn't get set.