[DUG] ListView - Scroll Event

Eric A eaa603 at hotmail.com
Mon Jul 28 05:50:28 NZST 2014


John, thanks for the response. 

You are correct - the TListBox component "OnClick" event does indeed respond to the keyboard, but unfortunately the same event on the TListView component only responds to mouse clicks.  Whether this component is just a wrapper around a MS component that only responds that way I don't know.

So, still a problem to sort out.

Also, another question - how to make one of the columns (the caption in my case) invisible - like using the "Visible" property on the columns of a DBGrid or a dataset.  There is no "Visible" property  on the Items or SubItems properties.

All this would have been super easy with a database but I am trying to avoid that if possible at present.

From: johnkbird at paradise.net.nz
To: delphi at listserver.123.net.nz
Date: Mon, 28 Jul 2014 02:24:33 +1200
Subject: Re: [DUG] ListView - Scroll Event







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.
 
(With data controls often the best approach is to use the change event on 
the datasource to detect the same thing).
 
So try the onclick event some more.


 

From: Eric A 
Sent: Sunday, July 27, 2014 9:07 PM
To: Delphi ListServer 
Subject: [DUG] ListView - Scroll Event
 

(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/a51c2dae/attachment.html 


More information about the Delphi mailing list