[DUG] ListView - Scroll Event

Eric A eaa603 at hotmail.com
Mon Jul 28 06:52:11 NZST 2014


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/46913ff5/attachment-0001.html 


More information about the Delphi mailing list