|
-
February 16th, 2004, 05:06 AM
#1
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.
-
February 16th, 2004, 08:05 AM
#2
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.
-
February 16th, 2004, 08:34 AM
#3
Hi...have you checked that the resource properties to ensure that 'single selection' is off? Hope this helps.
-
February 16th, 2004, 08:00 PM
#4
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
-
February 16th, 2004, 08:33 PM
#5
Did you find the flag value to use for the mask in SetItemState?
-
February 16th, 2004, 08:59 PM
#6
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."
-
February 16th, 2004, 09:48 PM
#7
Values beginning with LVIS are for state values. For the mask, you need flag values, which begin with LVIF. Look at the LVITEM structure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|