Select a row in List control with code?
-
I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers
-
I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers
ldsdbomber wrote:
...but would just like to know the correct method to programmatically set a row to be selected...
Use the
LVM_SETITEM
message.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
ldsdbomber wrote:
...but would just like to know the correct method to programmatically set a row to be selected...
Use the
LVM_SETITEM
message.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Is that via a SendMessage David? I've not used that before very much
-
Is that via a SendMessage David? I've not used that before very much
ldsdbomber wrote:
Is that via a SendMessage David?
Yes, if you are not using MFC.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Is that via a SendMessage David? I've not used that before very much
You can use:
SetItemState(index,LVIS_SELECTED | LVIS_FOCUSED,LVIS_SELECTED | LVIS_FOCUSED);
-
I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers
4.10 How do I programmatically select an item in a list view control?[^]
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.