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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to programmatically scroll a ListView

Status
Not open for further replies.

Goodall

MIS
Aug 4, 2004
18
US
I am trying to simulate the Microsoft Excel "Freeze Panes" function on a Visual Basic .NET form using two ListView controls.

Key_ListView: The control on the left will have one column entitled "Key" and have a numerical value.

Data_ListView: The control on the right will have about 30 columns. The 30 columns can't fit onto the screen at the same time. The user has to use the horizontal scroll bar to see the columns out of view.

Both ListViews have the same number of related records.

When the user scrolls the Data_ListView to the right (horizontal scroll bar) they will not lose "sight" of the key value in the Key_ListView. This is the functionality my users demand.

When the user scrolls the Data_ListView Up and Down (vertical scroll bar) I want the Key_ListView to scroll Up and Down as well. I want the records to stay in sync with each other in a vertical nature.

Using the .EnsureVisible property doesn't set the scroll position; it just makes sure the specific item is "somewhere" in the client window.

Thanks in advance for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top