ListView Scrolling not following SelectedItem?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

I have a long list of Items in a ListView... if I scroll down to something
that is not visible without scrolling and then click on it I open another
window where you can work with the details of that item..
Then I close that window I repopulate the ListView to reflect some changes
make in the details window.. and I re-set the selected Row after the
population of the ListView so the item I was working on is selected again..
but then the scroll is at the top..

How do I make the scroll set so that the selected Item is within the visible
part?

(I have set the Multiselect to false so there can be only one selected)

/Lars Netzel
 
Call the EnsureVisible method of the ListViewItem you want to make visible:
ListView1.Items(N).EnsureVisible

When N is the Index of the Item you want.
 
Back
Top