Hello Friends,
I have a ListBox with MultiSelect set to .T. It works properly with mouse clicks, Shift+Click, and Ctrl+Click. But something weird happens when ALL choices are selected programmatically...
In a CmdButton I am using this code to SelectAll the items...
FOR nI = 1 TO thisform.list1.ListCount
thisform.List1.Selected(nI) = .t.
NEXT
... and this does indeed set all the items to Selected (i.e. they become highlighted). So far so good.
But after this operation, if the mouse clicks on the scroll bar, the entire list de-selects; or if Ctrl+Click is used on any single item of the list (which should normally toggle the Select for only the item pointed), the entire list de-selects except the pointed item which remains selected.
Note that when I manually Select All (i.e. Click at top item, then Shift+Click the bottom item), it works normally in Windows mode. I.e., All are selected, then Ctrl+Click on any single item will toggle the selection.
It's only when I programmatically SelectAll that I have the problem.
What an I missing here?
TIA
wilfranz
I have a ListBox with MultiSelect set to .T. It works properly with mouse clicks, Shift+Click, and Ctrl+Click. But something weird happens when ALL choices are selected programmatically...
In a CmdButton I am using this code to SelectAll the items...
FOR nI = 1 TO thisform.list1.ListCount
thisform.List1.Selected(nI) = .t.
NEXT
... and this does indeed set all the items to Selected (i.e. they become highlighted). So far so good.
But after this operation, if the mouse clicks on the scroll bar, the entire list de-selects; or if Ctrl+Click is used on any single item of the list (which should normally toggle the Select for only the item pointed), the entire list de-selects except the pointed item which remains selected.
Note that when I manually Select All (i.e. Click at top item, then Shift+Click the bottom item), it works normally in Windows mode. I.e., All are selected, then Ctrl+Click on any single item will toggle the selection.
It's only when I programmatically SelectAll that I have the problem.
What an I missing here?
TIA
wilfranz