Given the documentation says:
If the DesktopListBox is in multiple-row selection mode, then the number of the lowest selected row is returned.
Then yes, that would work.
Given the documentation says:
If the DesktopListBox is in multiple-row selection mode, then the number of the lowest selected row is returned.
Then yes, that would work.
I wouldnāt have posted it if it didnāt worked
Yes, but thereās a difference between it working and it being guaranteed to work in the future. The documentation actually defines the behaviour in multiple selection conditions, which means it is safe for the future. If it hadnāt have been defined then it wouldnāt be āsafeā, even if it did work.
Testing proves that the following works no matter what the selection mode is. However, nothing is said in the documentation that says that is what happens, so would would have to use it with knowledge that it could change in the future.
Listbox1.SelectedRowIndex = -1
or more readble, and avoiding magic numbers:
Listbox1.SelectedRowIndex = DesktopListBox.NoSelection