listview autoscroll event?

A

ashley

How do i detect that the vertical scroll bar has been
moved and how do i get the vertical scrollbar value from
a listview. I need to do this to synchronise a textbox
movement within the listview.
 
N

Nicholas Paldino [.NET/C# MVP]

Ashley,

You will have to create a class that derives from ListView. In this
class, you will have to override the WndProc method and process the
WM_VSCROLL or WM_HSCROLL messages. The scrollbars send this to the ListView
in order to indicate that the scroll has been moved.

When processing that message, you can move the other windows
appropriately. Also, you can call the GetScrollInfo API function through
the P/Invoke layer to get the appropriate information about the standard
scroll bars for a window (using the handle for the ListView control).

Hope this helps.
 
A

ashley

Thanks Nicholas,

Have you got any code examples. It would help!

Ashley.
-----Original Message-----
Ashley,

You will have to create a class that derives from ListView. In this
class, you will have to override the WndProc method and process the
WM_VSCROLL or WM_HSCROLL messages. The scrollbars send this to the ListView
in order to indicate that the scroll has been moved.

When processing that message, you can move the other windows
appropriately. Also, you can call the GetScrollInfo API function through
the P/Invoke layer to get the appropriate information about the standard
scroll bars for a window (using the handle for the ListView control).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

How do i detect that the vertical scroll bar has been
moved and how do i get the vertical scrollbar value from
a listview. I need to do this to synchronise a textbox
movement within the listview.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top