[DUG] ListView - Scroll Event

Ross Levis ross at stationplaylist.com
Mon Jul 28 13:30:31 NZST 2014


I think you should be using OnSelectItem and only act when Selected = True.

 

From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Eric A
Sent: Monday, 28 July 2014 6:52 a.m.
To: Delphi ListServer
Subject: Re: [DUG] ListView - Scroll Event

 

Yes, multiple OnChange events are generated on the ListView control, for
both mouse clicks and navigation key depressions, as follows:

a) First mouse click or down arrow/PgDn key depression:
- Item = new selection

b) subsequent mouse clicks or down arrow/PgDn key depressions:
- Item - current selection
- Item= nil
- Item = new selection

Seems messy ...

  _____  

From: robo555 at gmail.com
Date: Sun, 27 Jul 2014 12:28:33 +0200
To: delphi at listserver.123.net.nz
Subject: Re: [DUG] ListView - Scroll Event

>From memory, when a record changes, first an event gets fired where selected
item is nil, then a second event gets fire where selected item is the new
item.

 

On Sun, Jul 27, 2014 at 11:07 AM, Eric A <eaa603 at hotmail.com> wrote:

(Delphi 7)

I  wish to detect the user selecting a row (item) in a ListView component to
display child records for  the item in another control.  

There is no "OnScroll" event for this control.  I can use the "OnClick"
event OK for a selection cia the mouse, but how do I detect when a user
scrolls on to a record by using the arrow keys (or PgUp, PgDn or moving the
scrollbar ?

I have tried the using the OnChange event but it seems that there are two
events generated for each movement by the arrow keys.

Does anyone have a code snippet to accomplish this?

Eric.


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
Subject: unsubscribe

 


_______________________________________________ NZ Borland Developers Group
- Delphi mailing list Post: delphi at listserver.123.net.nz Admin:
http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to
delphi-request at listserver.123.net.nz with Subject: unsubscribe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20140728/04d6ebf4/attachment.html 


More information about the Delphi mailing list