Listview Scrolling

  • Thread starter Thread starter Juan Romero
  • Start date Start date
J

Juan Romero

Hi guys,

Does anyone know how to catch a listview scroll event?

There are some things I need to refresh on the form, so I want to know when
the user scrolls the listview control.

Another even more useful thing would be to catch a paint event. Does anyone
know how?

Thanks!
 
Juan,

if you familliar with the Windows Message Pump, take a look at the VS.Help
for Control.WndProc.
In a nutshell:
* Derive the ListBox into a new class.
* Override WndProc (don't forget to call the base method!)
* Test for the scroll/wm_paint event(s) in the message event args (search
for "WM_*" in the file "winUser.h" (search for that, too, I don't know by
heart, where it is) to get all the message codes you need).

Hope that helps

Klaus

PS: Keep in mind that the ListBox class is only a wrapper around the
Windows-ListBox, so it's not easy to modify its behaviour if you don't have
detailed knowledge about the win32-api.
 
Back
Top