p***@gmail.com
2008-03-16 04:41:43 UTC
I'm attempting to progmatically select a single row in a CListCtrl
using the following:
m_list.SetItemState(-1, 0, LVIS_SELECTED); // deselect all rows
m_list.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED); // select row i
However, after doing this, the arrow keys don't select the row
adjacent to i (instead they select the row adjacent to the row
previously selected by a mouse click or via keyboard navigation).
To illustrate the problem, let i=10. If I navigate to row 5 using the
keyboard and then call the method containing the above code then row
10 is selected. If I then press the down arrow key, row 6, instead of
row 11, is selected.
Could someone please advise how to resolve this ?
Regards,
Patrick
using the following:
m_list.SetItemState(-1, 0, LVIS_SELECTED); // deselect all rows
m_list.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED); // select row i
However, after doing this, the arrow keys don't select the row
adjacent to i (instead they select the row adjacent to the row
previously selected by a mouse click or via keyboard navigation).
To illustrate the problem, let i=10. If I navigate to row 5 using the
keyboard and then call the method containing the above code then row
10 is selected. If I then press the down arrow key, row 6, instead of
row 11, is selected.
Could someone please advise how to resolve this ?
Regards,
Patrick