473,385 Members | 2,014 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,385 software developers and data experts.

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 15154
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*************@TK2MSFTNGP12.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*************************@reallyidont.com> schrieb im
Newsbeitrag news:cu*******************@news.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*************@TK2MSFTNGP12.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_MOUSEACTIVATE = &H21

Const WM_MOUSEMOVE = &H200

Private ctrl As Control

Public Sub New(ByVal ctrl As Control)

AssignHandle(ctrl.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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

sl = New MyListener(ListBox1)

end sub

Private Sub sl_MyScroll(ByVal sender As Object, ByVal e As System.EventArgs)
Handles sl.MyScroll

Me.Text = "Scroll"

End Sub


Ken

-------------------------------
"Urs Vogel" <uv****@msn.com> wrote in message
news:um*************@TK2MSFTNGP12.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
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...
2
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
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...
1
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...
0
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...
0
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
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...
1
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...

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.