You might like to know that I struggled with this and another problem, which
I eventually solved with a little trial and error.
On a Form Load I set the DataSource of my ListBox and looped through the
items collection inspecting values to determine which items I wanted to
select (and used the SetSelected method on those items), but the ListBox
only ever selected one item.
The ListBox Selection mode was set to MultiSimple, but I also tried
MultiExtended. After running the selection routine, I looped through the
items collection again and displayed a message to show me which items were
apparently selected. Everything appeared to be OK - multiple items were
selected! But the display only showed one item selected???
I moved the selection routine from the Form Load event to Activate and Focus
but this wasn't the answer. However, if I ran the same routine on a Form
Click, hey presto all the required items were selected - so I knew my
routine to select multiple items DID work. SO why did it not work on Form
Load, Activate or Focus? It is not a real option to get users to click the
form (or a button) to see what they should see automatically on Form Load.
The answer was to run the routine in Form Paint. Something is happening
AFTER Load and Activate to deselect the items I selected in my code.
Although I have discovered this "work around", I would say this is an
undesirable feature (bug) in the ListBox which should be corrected.
Ken