473,699 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListView Scroll Event

Hi

I'm looking for a way to trap the ListView's scroll events, in order to
control page-wise loading of not bindable data. Any hints of how to achieve
this?

Thanks, Urs
Nov 21 '05 #1
3 15244
What you want is a "virtual list view". I don't see ListView as
particularly viable for this (I have tried it before). In the end I wrote
my own control which does the same and allows me to owner draw each row
(including images in cells).
"Urs Vogel" <uv****@msn.com > wrote in message
news:um******** *****@TK2MSFTNG P12.phx.gbl...
Hi

I'm looking for a way to trap the ListView's scroll events, in order to
control page-wise loading of not bindable data. Any hints of how to
achieve this?

Thanks, Urs

Nov 21 '05 #2
Thanks Robin

I'll inherit ListView and attach my own vertical scroll bar, using some API
calls to achieve some controllable and synchronized scrolling behaviour.

Urs

"Robin Tucker" <id************ *************@r eallyidont.com> schrieb im
Newsbeitrag news:cu******** ***********@new s.demon.co.uk.. .
What you want is a "virtual list view". I don't see ListView as
particularly viable for this (I have tried it before). In the end I wrote
my own control which does the same and allows me to owner draw each row
(including images in cells).
"Urs Vogel" <uv****@msn.com > wrote in message
news:um******** *****@TK2MSFTNG P12.phx.gbl...
Hi

I'm looking for a way to trap the ListView's scroll events, in order to
control page-wise loading of not bindable data. Any hints of how to
achieve this?

Thanks, Urs


Nov 21 '05 #3
Hi,

Use the native window class to listen for the scroll messages on
the listbox. Will work with any control.

' NativeWindow class to listen to operating system messages.

Private Class MyListener

Inherits NativeWindow

Public Event MyScroll(ByVal sender As Object, ByVal e As EventArgs)

Const WM_MOUSEACTIVAT E = &H21

Const WM_MOUSEMOVE = &H200

Private ctrl As Control

Public Sub New(ByVal ctrl As Control)

AssignHandle(ct rl.Handle)

End Sub

Protected Overrides Sub WndProc(ByRef m As Message)

' Listen for operating system messages

Const WM_HSCROLL = &H114

Const WM_VSCROLL = &H115

If m.Msg = WM_Hscroll Or m.Msg = wm_vscroll Then

RaiseEvent MyScroll(ctrl, New EventArgs)

End If

MyBase.WndProc( m)

End Sub

Protected Overrides Sub Finalize()

ReleaseHandle()

MyBase.Finalize ()

End Sub

End Class

Dim WithEvents sl As MyListener

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

sl = New MyListener(List Box1)

end sub

Private Sub sl_MyScroll(ByV al sender As Object, ByVal e As System.EventArg s)
Handles sl.MyScroll

Me.Text = "Scroll"

End Sub


Ken

-------------------------------
"Urs Vogel" <uv****@msn.com > wrote in message
news:um******** *****@TK2MSFTNG P12.phx.gbl...
Hi

I'm looking for a way to trap the ListView's scroll events, in order to
control page-wise loading of not bindable data. Any hints of how to achieve
this?

Thanks, Urs

Nov 21 '05 #4

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

Similar topics

2
410
by: Mike Ruane-Torr | last post by:
I have a design problem involving a ListView control on a Windows form. What it boils down to is the following question: Q: Is there a way to tell the difference between a ListView.ItemCheck event that has occurred because of a mouse click on a Checkbox, and one that has occurred because the .Checked property of an item has been changed programatically? More details if needed, but if you can answer the above, you'll have solved the...
2
5068
by: ashley | last post by:
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.
3
4904
by: Peter Row | last post by:
Hi, I have created a user control consisting of a textbox and a separate vertical scroll bar. The textbox is filled with data. However there could be lots of data so I only fill the textbox with enough to fill the space visible without scrolling. Having set the min and max values of my separate vertical scrollbar I use that to scroll the data. So for example the textbox could be displaying 50 lines of data but in actual fact there is...
1
3383
by: johnperkins | last post by:
I am curious as to why the scrollbar.scroll event gets called twice Here is an example of my code Private Sub vsbMoveCar_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles vsbMoveCar.Scrol 'Position the up and down movemen 'Used when the scroll box is move picCar.Top = vsbMoveCar.Valu X +=
0
1222
by: Peter | last post by:
Hi,everyone, I'm using a listview control to deal with data. The ItemCheckEventArgs have 2 properties:CurrentValue and NewValue in listview.itemcheck event. Can anybody tell me when does the newvalue become currentvalue after the event? I'm worring about this because 'listview1.CheckedItems.Count()' didn't change after I changed listview1's check state' Thank you
0
1068
by: Martin | last post by:
Hi all, I'm trying to find an item scroll event for this listview, but I can't find it. I must be overlooking something... Tia, Martin
2
6630
by: ian.watkins | last post by:
I'm having a problem with the listview itemcheck event since upgrading a smart device app from VS2003 VB.NET CF1.0 to VS2005 VB.NET CF2.0. I'm using the listview item checkbox to indicate if the item is "processed". When the item becomes processed, i set the listviewitem.checked property to true. To prevent the user from changing the state of the box manually, i use the itemcheck event and set:
1
5799
by: tc | last post by:
Hello Using .NET 2.0, What would be the best way to capture a scroll event from a list box? Thanks in advance Thomas
0
1203
by: viepia | last post by:
Hi, What is the best way to find the row/column of a System.Windows.Forms.ListView MouseDoubleClick event? Searching the rows and columns for SelectedItems will not work for me, too many duplicated values. Thanks Viepia
0
8705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9199
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8943
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6550
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5884
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.