473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Listview Scrolling

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!
Nov 20 '05 #1
2 3823
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.
"Juan Romero" <ju*********@bowne.com> schrieb im Newsbeitrag
news:Oh**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 20 '05 #2
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.
"Juan Romero" <ju*********@bowne.com> schrieb im Newsbeitrag
news:Oh**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
1
by: SlantyOD | last post by:
Hi All, I'm trying to tie two ListViews together so that when the user scrolls one, the other stays 'in sync'. Since there are no OnScroll events, and the scroll bar position is unavailable,...
0
by: Navin | last post by:
Hi, I am making a code editor in C# and want to display line numbers to the left. I have a UserControl with a ListView docked to the left edge and a TextBox that makes up the rest. I am able to...
2
by: Gary Brown | last post by:
Hi, How do you programmatically scroll a ListView control horizontally? (The same effect as if the user used the horizontal scroll bar,) I've done it in C++/MFC, but can't find the means in C#. ...
0
by: Tim Bücker | last post by:
Hello. Is it really not possible to hide the scrollbars of a listview ( this.listview.Scrollable = false; ) but do some scrolling anyway ( for instance: PostMessage(this.listview.Handle,...
4
by: Lars Netzel | last post by:
I have a long list of Items in a ListView... if I scroll down to something that is not visible without scrolling and then click on it I open another window where you can work with the details of...
0
by: Danny Tuppeny | last post by:
Hi all, I have a need to display a message list in the same way as Outlook Express/Thunderbird displays new posts (and probably most other newsreaders, like the one you're using now!). I know...
5
by: Martin Horn | last post by:
Hi all, I want to implement a listview with editable subitems and I assume the easiest way is to overlay a textbox over the item to be edited. With this in mind I have come up with: Using...
2
by: Sin Jeong-hun | last post by:
I often use detail view of the ListView control to display tabular data (is there any better way?) Many real-world applications display buttons, progress bars or dropdown lists in the columns, but...
0
by: Jarppi | last post by:
Hi All, Not sure how to go about this one. I've got a windows form with five ListView controls, each listing the files in a seperate folder. What I want to achieve is this: When I scroll any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.