Board index » delphi » TListBox ScrollBar event handler !!!

TListBox ScrollBar event handler !!!

I wanna handle TListBox scrollbar. After a few hours hard work I handled the
scrollbar of my form with Windows message 'wm_VScroll". Anyone have an idea
how to handle the scrollbar only for the listbox ? Please Help !!!
 

Re:TListBox ScrollBar event handler !!!


Quote
In article <3912ac97@dnews>, Svilen Stefanov wrote:
> I wanna handle TListBox scrollbar. After a few hours hard work I handled the
> scrollbar of my form with Windows message 'wm_VScroll". Anyone have an idea
> how to handle the scrollbar only for the listbox ? Please Help !!!

You should not try to do that from outside the listbox control (e.g. from the
form level). It is not impossible but cumbersome and error-prone. Instead make
a descendent of TListbox and add handlers for WM_VSCROLL and (if you need it)
WM_HSCROLL to it. These handlers can then fire custom events to inform the
form etc. of the scroll events.

I just posted code for a TStringgrid with scroll events to a thread in
delphi.ObjectPascal, look for a message with subject "Trapping the
scrollbars".

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads