Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried this code:

m_list.SetItemState(1, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);


but it's selected with a grey, instead when I select manually there is a blue..why?

What I have tried:

I tried with setFocus() but it's the same thingh
Posted
Updated 1-Dec-20 3:37am
v2

1 solution

you also need to call SetSelectionMark after updating the item states.

SetItemState(prev_item, ~LVIS_SELECTED, LVIS_SELECTED);
SetItemState(new_selected_item, LVIS_SELECTED, LVIS_SELECTED);
SetSelectionMark(new_selected_item);


The answer was given by learn textile
 
Share this answer
 
Comments
Member 14594285 1-Dec-20 9:48am    
it's the same thing, I have grey and not blue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900