By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

HowTo: Synchronise Scroll Position of Two ListView Controls

P: n/a
Can anyone suggest how to keep two ListView controls synchronised?

It is a common scenario: two ListView controls, side-by-side, containing
similar data. I want to scroll one control and have the other scroll
identically.

I have tried intercepting the WM_VSCROLL message and sending it on to the
second control, but this only works when the user clicks the up and down
scroll buttons, or clicks above or below the elevator.

If the user drags the elevator nothing happens, even though the WM_VSCROLL
messages are still getting passed on.

Another technique I have tried is to send an explicit LVM_SCROLL message to
the second control, but the synchronisation is jerky, and only completely
synchronises when the elevator is released.

[Incidentally, another point is that when I resize the form containing my
two ListView controls, I resize the controls to make them each occupy half
the form. When I do this they both flicker madly. Is there any way to stop
the flickering? Enabling double-buffering doesn't make a blind bit of
difference.]

TIA

Charles
Nov 28 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.