473,544 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3839
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*********@bo wne.com> schrieb im Newsbeitrag
news:Oh******** ******@TK2MSFTN GP12.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*********@bo wne.com> schrieb im Newsbeitrag
news:Oh******** ******@TK2MSFTN GP12.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
3846
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. now use task manager to see the GDI usage of the process. everything seems normal. now catch the ListView's scroller and start to move it...
1
10575
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, I've been forced to create my own ListView class and override WndProc. In this I've caught all instances of WH_VScroll and WH_HScroll, and then I can...
0
1427
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 add items to the ListView when a new line is entered in the TextBox (these items are the line numbers). What I am not able to figure out is how to...
2
12510
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#. Autoscroll is enabled. Also, I need to know if the user scrolls the ListView horizontally. Thanks,
0
2862
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, WM_VSCROLL, wParam, lParam); ) I really hope someone can tell me that it is possible... .... I want to do the scrolling using a custom scrollbar at...
4
9040
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 that item.. Then I close that window I repopulate the ListView to reflect some changes make in the details window.. and I re-set the selected Row...
0
1857
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 there are commercial options but a) I don't want to pay and b) they're all massively bloated. I want exactly a TreeList + ListView, and I want it to...
5
2360
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 fullrowselect=true in the listview Private Sub ListView1_ItemSelectionChanged(ByVal sender As Object, _
2
1856
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 it seems like ListView only allows texts. I guess if I can only know the exact bounds of the columns, I could overlay other Windows controls on it...
0
1710
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 of the ListView controls, I'd like the other ListView controls to scroll to the same position. I've check, but cannot find a Scrolling or Scroll...
0
7637
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7400
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7727
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5940
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5311
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4934
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3427
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
998
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.