How to handle scroll event on a list view

Night

Newcomer
Joined
Apr 24, 2003
Messages
13
Location
Ha Noi - Viet Nam
The list view only expose the Scrollable property, which enable/disable the scroll bar. It doesn't support:
- Scroll event
- Viewable area of the list view when scrolling.

My problem is I make a customize listview, when I double click on a "cell", a text box is put on the list view to allow edit cell's value.
But when editing the text box, user can scroll the list view left-right, but the text box stay at the same place so it looks funny.

Anyone have the same problem like me?
 
Yes, the lack of the Event is a problem and I've requested it through the MVP program a few times now, so hopefully we'll see this event in the future, so you can attach to the scroll bar easily (and i'm sure there's a way you can listen to the windows messages coming through to do it, but i can't say i'd know how).

In the mean time, just out of curiosity, have you tried adding your TextBox to the Controls Collection of your ListView to see if it scrolls with everything then?
 
I've found the solution for this
Override the WndProc function ( it is available for any control)
Here we can catch every message window pass to the control.
Catch WM_SCROLL to know when the list view is scrolling
 
Last edited:
Back
Top