<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Yes, you're correct.<br><br><div><hr id="stopSpelling">From: ross@stationplaylist.com<br>To: delphi@listserver.123.net.nz<br>Date: Mon, 28 Jul 2014 13:30:31 +1200<br>Subject: Re: [DUG] ListView - Scroll Event<br><br><style><!--
.ExternalClass .ecxshape {
}
--></style><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}
.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}
.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate {
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
}
.ExternalClass span.ecxhoenzb {
}
.ExternalClass span.ecxEmailStyle19 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}
.ExternalClass span.ecxBalloonTextChar {
font-family:"Tahoma","sans-serif";
}
.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}
.ExternalClass div.ecxWordSection1 {
}
--></style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";color:#1F497D;">I think you should be using OnSelectItem and only act when Selected = True.</span></p><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";" lang="EN-US"> delphi-bounces@listserver.123.net.nz [mailto:delphi-bounces@listserver.123.net.nz] <b>On Behalf Of </b>Eric A<br><b>Sent:</b> Monday, 28 July 2014 6:52 a.m.<br><b>To:</b> Delphi ListServer<br><b>Subject:</b> Re: [DUG] ListView - Scroll Event</span></p></div></div><p class="ecxMsoNormal"> </p><div><p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">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 ...</span></p><div><div class="ecxMsoNormal" style="text-align:center;" align="center"><span style="font-family:"Calibri","sans-serif";"><hr id="ecxstopSpelling" align="center" size="3" width="100%"></span></div><p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">From: <a href="mailto:robo555@gmail.com">robo555@gmail.com</a><br>Date: Sun, 27 Jul 2014 12:28:33 +0200<br>To: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Subject: Re: [DUG] ListView - Scroll Event</span></p><div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p></div><div><p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"> </span></p><div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">On Sun, Jul 27, 2014 at 11:07 AM, Eric A <<a href="mailto:eaa603@hotmail.com" target="_blank">eaa603@hotmail.com</a>> wrote:</span></p><div><div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">(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 "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 ?<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 style="color:#888888;"><br><br><span class="ecxhoenzb">Eric.</span></span></span></p></div></div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><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</span></p></div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p></div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><br>_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: <a href="mailto:delphi@listserver.123.net.nz">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">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</span></p></div></div></div><br>_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request@listserver.123.net.nz with Subject: unsubscribe</div>                                            </div></body>
</html>