mark a row as selected in a list control
-
Hello guys, I am trying to play with a List control (report style) and I would like to do the following thing : I select a row in my list (that becomes highlighted) and, thanks to 2 buttons (UP and Down), I exchange the place of this raw with the previous one (UP) to make it go to the top of the list or with the next one (DOWN) to make it go to the bottom of the list. After a click on one of my buttons, I exchange the 2 rows, my row is no more highlighted and I would like it to keep highlighted. I have tried to play with the SetItemState to set the focus and the selection bits to make it highlighted again but without success. So my question is : how do I give my row this selected aspect (highlight) by program? Thanks in advance DD
-
Hello guys, I am trying to play with a List control (report style) and I would like to do the following thing : I select a row in my list (that becomes highlighted) and, thanks to 2 buttons (UP and Down), I exchange the place of this raw with the previous one (UP) to make it go to the top of the list or with the next one (DOWN) to make it go to the bottom of the list. After a click on one of my buttons, I exchange the 2 rows, my row is no more highlighted and I would like it to keep highlighted. I have tried to play with the SetItemState to set the focus and the selection bits to make it highlighted again but without success. So my question is : how do I give my row this selected aspect (highlight) by program? Thanks in advance DD
m_List.SetItemState(index,LVIS_SELECTED, LVIS_SELECTED); this will do
-
m_List.SetItemState(index,LVIS_SELECTED, LVIS_SELECTED); this will do
hello, that's exactly what I tried (except if my memory fails), LVIS_SELECTED as value and as mask ... I also tried LVIS_FOCUSED ... but without success. I will doublecheck tonite. This should immediatly highlight the item, no need of redraw or something else ? Thanks for the answer DD
-
Hello guys, I am trying to play with a List control (report style) and I would like to do the following thing : I select a row in my list (that becomes highlighted) and, thanks to 2 buttons (UP and Down), I exchange the place of this raw with the previous one (UP) to make it go to the top of the list or with the next one (DOWN) to make it go to the bottom of the list. After a click on one of my buttons, I exchange the 2 rows, my row is no more highlighted and I would like it to keep highlighted. I have tried to play with the SetItemState to set the focus and the selection bits to make it highlighted again but without success. So my question is : how do I give my row this selected aspect (highlight) by program? Thanks in advance DD
-
Have you tried LVS_SHOWSELALWAYS Style? It always show the selection, even if the control does not have the focus. Use
SetExtendedStyle()
to set the LVS_SHOWSELALWAYS. P. -
Have you tried LVS_SHOWSELALWAYS Style? It always show the selection, even if the control does not have the focus. Use
SetExtendedStyle()
to set the LVS_SHOWSELALWAYS. P.Strange .. it doesn't work. In fact, if I add the LVS_SHOWSELALWAYS option, the control works as if there was a hot item, the fact to keep the mouse pointer over an item selects it, but as soon as I click my buttons, the highlight desappears ... Very strange ... Could it be a kind of icompatibility with another option? I also use : LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_INFOTIP, LVS_REPORT I really don't understand what happens .. Thanks in advance for help DD