Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll to selection in listview control

Status
Not open for further replies.

chronobyte

Programmer
Mar 30, 2002
5
0
0
US
Hi, does anybody know how to programmatically scroll a list view control to the selected item when it is out of view?

I'm working on an application that perform item search in a list view. When the item is found I can programmatically highlight the item and set focus on the selected item. However for the life of me I can't figure out how to bring the item into view when the item selected happens to be outside the control's view port. The control doesn't automaticaly scroll for you.

I'm looking for something equivalent to the TextBox class' ScrollToCaret() method. Or if there isn't one, does anybody have a trick for doing that?

Any tips will be greatly appreciated, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top