<div dir="ltr">So you just need to use the OnChange event, and check the item is not nil. From memory I don&#39;t think you need to check whether item is different to previous item.<br><br>Robo<br></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Sun, Jul 27, 2014 at 8:52 PM, Eric A <span dir="ltr">&lt;<a href="mailto:eaa603@hotmail.com" target="_blank">eaa603@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">Yes, multiple OnChange events are generated on the ListView control, for
 both mouse clicks and navigation key depressions, as follows:<br><br>a) First mouse click or down arrow/PgDn key depression:<br>- Item = new selection<br><br>b) subsequent mouse clicks or down arrow/PgDn key depressions:<br>

- Item - current selection<br>- Item= nil<br>- Item = new selection<br><br>Seems messy ...<br><br><div><hr>From: <a href="mailto:robo555@gmail.com" target="_blank">robo555@gmail.com</a><br>Date: Sun, 27 Jul 2014 12:28:33 +0200<br>

To: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><div class=""><br>Subject: Re: [DUG] ListView - Scroll Event<br><br></div><div><div class="h5"><div dir="ltr">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.<br>

</div><div><br><br><div>

On Sun, Jul 27, 2014 at 11:07 AM, Eric A <span dir="ltr">&lt;<a href="mailto:eaa603@hotmail.com" target="_blank">eaa603@hotmail.com</a>&gt;</span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">






<div><div dir="ltr">(Delphi 7)<br><br>I  wish to detect the user selecting a row (item) in a ListView component to display child records for  the item in another control.  <br><br>There is no &quot;OnScroll&quot; event for this control.  I can use the &quot;OnClick&quot; 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 ?<br>



<br>I have tried the using the OnChange event but it seems that there are two events generated for each movement by the arrow keys.<br><br>Does anyone have a code snippet to accomplish this?<span><font color="#888888"><br>



<br>Eric.<br>                                               </font></span></div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>
<br>_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</div></div></div>                                               </div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>