strange behavior when selecting multiple rows from a listbox

the multiple selection behaves strangely in the listbox with SelectionType = “Multiple” . let’s suppose that I’m standing in row 10. if I want to select row 10, 11, 12 and 13 I simply press the Shift key + the down key. Now let’s suppose that I want to deselect row 13, then what I do is continue pressing the Shift key but now I press the key up. What happens is that it selects row 9 and if I continue, it will select row 8, row 7…

I think that is not the behavior expected by most users. is this an error? is there any way to change this behavior?

Translated with www.DeepL.com/Translator

I have noticed this myself, and I know it is because Listbox is not a native control. You’ll find a similar selection style mismatch in the Xojo text editor when performing a similar complicated selection change.

I am not certain if there is a workaround.

What about the strange text selection behavior ?

And once a text is selected, pressing the right arrow (for example) does not behave as I expect it to…

There are tons of strange stuff in the IDE.

[quote=446847:@nicolscanessa]the multiple selection behaves strangely in the listbox with SelectionType = “Multiple” . let’s suppose that I’m standing in row 10. if I want to select row 10, 11, 12 and 13 I simply press the Shift key + the down key. Now let’s suppose that I want to deselect row 13, then what I do is continue pressing the Shift key but now I press the key up. What happens is that it selects row 9 and if I continue, it will select row 8, row 7…

I think that is not the behavior expected by most users. is this an error? is there any way to change this behavior?

Translated with www.DeepL.com/Translator[/quote]
I just tried this in both 2019r1 and the r2 beta 6. They behave the same way. If you believe the behavior should be changed, please file a feature request.

1 Like

What seems to be happening in the listbox with SelectionType = Multiple is that the ListIndex gets set to the initially selected row. If you add lower numbered rows to the selection the ListIndex gets set to the lowest added row. BUT if you add a higher numbered row to the selection, the ListIndex doesn’t change.

IMO the ListIndex shouldn’t get changed in either case.

<https://xojo.com/issue/56642>