Hello,
Normally, if you select an entry in a ListBox, the previous one is automatically deselected. This works well if both entries are visible in the ListBox.
I do however have a strange ListBox problem when autoscrolling.
The first image shows diagonal.stack(c4).pdf selected using the left mouse button. By looking at the scroll bar, you would note that there are other files above the current view.
I then click the number 7 on the keyboard to autoselect a file which happens to be out of view.
The file is 74.pdf which is autoselected and the listbox scrolls to make it visible. See the second image. So far so good.
The problem is that after a few seconds, the previous selection reappears and is NOT DESELECTED!
The ListBox is an Extended Selection listbox inside a FormView dialog box
Following is my existing code to handle OnKeyDown
void CFiles_LB::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
// trap shift and control selection keys to prevent endless loop
case VK_RETURN:
do something
return;
case VK_SHIFT:
return;
case VK_CONTROL:
return;
default:
break;
}
return;
}
Thanks for any assistance...
Normally, if you select an entry in a ListBox, the previous one is automatically deselected. This works well if both entries are visible in the ListBox.
I do however have a strange ListBox problem when autoscrolling.
The first image shows diagonal.stack(c4).pdf selected using the left mouse button. By looking at the scroll bar, you would note that there are other files above the current view.
I then click the number 7 on the keyboard to autoselect a file which happens to be out of view.
The file is 74.pdf which is autoselected and the listbox scrolls to make it visible. See the second image. So far so good.
The problem is that after a few seconds, the previous selection reappears and is NOT DESELECTED!
The ListBox is an Extended Selection listbox inside a FormView dialog box
Following is my existing code to handle OnKeyDown
void CFiles_LB::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
// trap shift and control selection keys to prevent endless loop
case VK_RETURN:
do something
return;
case VK_SHIFT:
return;
case VK_CONTROL:
return;
default:
break;
}
return;
}
Thanks for any assistance...