Re: Capturing scrolling of Delphi TListbox


[ DelphiLand FAQ ]

Posted by webmaster Guido on March 11, 2004 at 15:30:09:

In Reply to: Capturing scrolling of Delphi TListbox posted by Joey on March 07, 2004 at 22:45:19:

: with Delphi TListBox... how can i see if the user has scrolled??? at the moment i have a timer set to check the TopIndex and if it differs to the previously set one it fires the event... but is there a proper way of doin it??

--------------------------------------

There is no OnScroll event for Delphi's TListbox, nor its ancestor TCustomListbox. That's because its vertical scrollbar is handled directly by Windows (not by Delphi's VCL code).

You can't derive a custom component from TListbox or TCustomListbox with an OnScroll property. If you want such a component, I'm afraid you'll have to write it from scratch.

(Note: there are only two components with scrollbars that you can control yourself: TForm and TScrollBox.)

So, is it the "proper way" how you handle things? If it works, it's OK :) -- anyway it's easier than writing a complete new TJoeyScrollbox ;-)


Related Articles and Replies:



[ DelphiLand: free Delphi source code, tips, tutorials ]