-
using SetItemState
Hi there
for(int i=0;i<=5;i++)
{
m_ImageList.SetItemState(i,LVIS_SELECTED,LVIS_SELECTED);
}
How to selete more than one item by using SetItemState function?
I can just get one or last one item being seleted.
I need to selete multiple items when i start i dialog.
-
Saying "How to selete more than one item by using SetItemState function?" seems to say you are tring to use SetItemState to find items. That might be why you did not get a response sooner.
The documentation of SetItemState is not as complete as it should be but it should be obvious that a "state" value is not the same as a "mask" value; therefore don't use LVIS_SELECTED for the mask value.
-
Hi...have you checked that the resource properties to ensure that 'single selection' is off? Hope this helps.
-
Sorry for asking the wrong question.
i use CListCtrl to show Bitmap, and i want all of Bitmaps getting focus automatically when i open my dialog. Therefore, i use ClistCtrl's function SetItemstate to set each Bitmap's focus,but only one bitmap get focus.
Thanks
-
Did you find the flag value to use for the mask in SetItemState?
-
Thank you for your help.
Do you mean "LVIS_FOCUSED","'LVIS_CUT".........
I found "LVIS_FOCUSED", but the MSDN states " The item has the foucs, so it is surrounded by a standard focus rectangle, Although more than one item may be selected, only one item can have the focus."
-
Values beginning with LVIS are for state values. For the mask, you need flag values, which begin with LVIF. Look at the LVITEM structure.