if an item in a listbox is being selected via selected(n) and it is out of view or beyond the scroll area, how can i
bring that item in the list into view ie ( auto scroll to that item and selected it )
Ex: listBox.Selected(n) = TRUE
Property (As Integer)
aListBox.ScrollPosition = newIntegerValue
IntegerValue = aListBox.ScrollPosition
Zero-based index of the top visible row in the ListBox.
Read ScrollPosition to determine the top visible row; write to ScrollPosition to scroll the ListBox. When the scrollbar thumb is scrolled to the bottom, ScrollPosition cannot be incremented any further.
I have a similar problem. How would one do this if the selected item hasn't changed but the list order has, i.e. when sorted? For example, I have a listbox with 100 items and I click the header to sort the listbox the selected item may no longer be visible. How can I find the selected item and then scroll to that position?