Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

listview scrollbar question

0 views
Skip to first unread message

CobraS...@al.com

unread,
Mar 7, 2006, 3:37:10 PM3/7/06
to
Hi All,
How can I get to scroll bars of a listview, I am trying to sync two listviews so I need to overload
one of the listview, How can I achieve this ?

Thank You.


Nicholas Paldino [.NET/C# MVP]

unread,
Mar 7, 2006, 4:30:15 PM3/7/06
to
What you want to do is create a class that derives from ListView where
you override the WndProc method. You want to handle the WM_VSCROLL and
WM_HSCROLL messages. When the message fires, you can raise an event to
indicate that the scroll position changed in the listview.

Then, have the listviews subscribe to those events on each other, and
have the scroll position change when it changes in the other list view.

You will have to make sure that you don't get into an infinite loop,
since when you move the scrollbar in response to the first lisview scroll
moving, it will fire the same event.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

<CobraS...@al.com> wrote in message
news:114176383...@despina.uk.clara.net...

Michael Nemtsev

unread,
Mar 7, 2006, 4:33:54 PM3/7/06
to
Hello CobraS...@al.com,

The idea is here http://www.dicks-blog.com/archives/2004/07/08/listbox-scrolling/

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


0 new messages