How to highlight all rows in listbox between two index values?

ken76

Member
Joined
Nov 15, 2018
Messages
23
Programming Experience
5-10
Is it possible to highlight all rows in listbox between two index values?
If it possible how is it done?
 
If the listbox is multi select, yes you can. You would mark those items as selected.

If the listbox is not multi select, or you want to truly highlight, but not change the selection, then you would need to do owner drawn items and paint the highlighted items differently than the non-highlighted items.
 
Assuming that you do mean "select" rather than just "highlight", the ListBox has a SetSelected method that takes an item index. Hopefully it's obvious how to use that with a range of indexes.
 
Back
Top Bottom