How to handle scroll event on a list view

Night

Member
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 doesnt 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 cells 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 Ive requested it through the MVP program a few times now, so hopefully well see this event in the future, so you can attach to the scroll bar easily (and im sure theres a way you can listen to the windows messages coming through to do it, but i cant say id 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?
 
Ive 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 by a moderator:
Back
Top