Link to home
Start Free TrialLog in
Avatar of expertfan
expertfan

asked on

scrolling two listview controls simultanesouly.

friends,

i have two listview controls, placed next to each other. Each of them have 1000 records [listview style = report]

If i scroll the 'right hand side' listview control vertically, parallelly i want even the 'left hand side' listview control to scroll so that if rows 55 to 65 are displayed on the righthandside listview, the same 55 to 65 rows must be displayed on the left side also.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alkali_Guy
Alkali_Guy

Subclass the listview control, e.g. as "CScrollListView."  Assign a pointer to a member of the class, pointing to the other control.  When you receive the WM_VSCROLL message in the object (OnVScroll handler), use the Scroll method to scroll the other control to the corresponding position.  I think you can get the object's scroll position using GetOrigin.
Oops, wrong topic area.......         Yoink!
why would one use 2 listviews instead of one if they need to be scrolled at the same time?