<HTML><HEAD>
<STYLE><!--
..hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></STYLE>
</HEAD>
<BODY class=hmmessage dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Haven’t tried with Listview, but in stringgrid and listbox, checkbox etc
the onclick event fires with the mouse, or on moving with the arrow key
(D2007). (As long as there is a current element its more or less logical
to have a click event also respond to the keyboard as it wouldn’t be much use
otherwise). I have used stringrids and listboxes to do exactly what you
want – as current record changes in the first to show more detail in a second
control.</DIV>
<DIV> </DIV>
<DIV>(With data controls often the best approach is to use the change event on
the datasource to detect the same thing).</DIV>
<DIV> </DIV>
<DIV>So try the onclick event some more.</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=eaa603@hotmail.com
href="mailto:eaa603@hotmail.com">Eric A</A> </DIV>
<DIV><B>Sent:</B> Sunday, July 27, 2014 9:07 PM</DIV>
<DIV><B>To:</B> <A title=delphi@listserver.123.net.nz
href="mailto:delphi@listserver.123.net.nz">Delphi ListServer</A> </DIV>
<DIV><B>Subject:</B> [DUG] ListView - Scroll Event</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<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 "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?<BR><BR>Eric.<BR></DIV>
<P>
<HR>
_______________________________________________<BR>NZ Borland Developers Group -
Delphi mailing list<BR>Post: delphi@listserver.123.net.nz<BR>Admin:
http://delphi.org.nz/mailman/listinfo/delphi<BR>Unsubscribe: send an email to
delphi-request@listserver.123.net.nz with Subject:
unsubscribe</DIV></DIV></DIV></BODY></HTML>