Board index » delphi » Scrolling, just scrolling

Scrolling, just scrolling

I need to coordinate other things with items in a TListBox. How can I
tell when the user has manually scrolled it up or down; what event is
raised??
 

Re:Scrolling, just scrolling


You can't unless you derive a new component from TListBox and intercept the
WM_VSCROLL message. If you need help on doing this, mail me and i'll give
you an example.

Alex.

Quote
Roy Sheridan wrote in message <375FD177.A44FE...@orchestration.com>...

|I need to coordinate other things with items in a TListBox. How can I
|tell when the user has manually scrolled it up or down; what event is
|raised??
|

Re:Scrolling, just scrolling


Quote
>Roy Sheridan wrote:

>I need to coordinate other things with items in a TListBox. How can I
>tell when the user has manually scrolled it up or down; what event is
>raised??

To "coordinate other things" you might want to retrieve a string after
scrolling, so maybe you can use this:

var
  n, y : integer;
  s : string;

y := GetScrollPos( ListBox.Handle, SB_VERT ) + n;
       //gets the topmost + n of the *visible* listbox items
s := ListBox.Items[y];
_________
Andreas

Re:Scrolling, just scrolling


Thank you - a simple example would be appreciated!! Thanks.
Quote
Alexandru Preda wrote:
> You can't unless you derive a new component from TListBox and intercept the
> WM_VSCROLL message. If you need help on doing this, mail me and i'll give
> you an example.

> Alex.

> Roy Sheridan wrote in message <375FD177.A44FE...@orchestration.com>...
> |I need to coordinate other things with items in a TListBox. How can I
> |tell when the user has manually scrolled it up or down; what event is
> |raised??
> |

Other Threads