How Do I Scroll The Selected Item in the List View to the Top ?

kiddashy

Member
Joined
Nov 10, 2012
Messages
6
Programming Experience
Beginner
So I Have Like 10 Items in the List View.
So if i Click The Last Item in the List View How would I scroll it to the Top of the List View ??

Thanks,
 
You wouldn't. The last item in the ListView cannot be higher than the bottom of the control unless there are not enough items in the control to fill it. You can assign an item to the TopItem property of the ListView and it will scroll to the top if possible and, if not, as far up the control as it can.

For future reference, you really should consult the MSDN documentation first when you have a question. You wanted to do something with a ListView so you should have read the documentation for the ListView class. If you'd done that then you'd have found the TopItem property for yourself quite quickly. Not all questions can be answered by the documentation but many can. It should always be your first port of call.
 
Back
Top