Move Srtollbar in listbox

How do I automatickly move a scrollbar to the bottom of af listbox.
(I dont meen by using the mouse)
bye
jeabpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
Hi,
maybe count the listbox items divide by
how many are in a pagedown movement of scroll and send that many times this message:

SendMessage(Listbox1.Handle,WM_VSCROLL, B_PAGEDOWN,0)
0
intheCommented:
typo B_PAGEDOWN
 should read    SB_PAGEDOWN
0
intheCommented:
this will work :

procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i := 0 to listbox1.items.Count -1 do
begin
sendmessage(listbox1.handle,WM_VSCROLL,SB_PAGEDOWN,0);
end;
end;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PeterLarsenCommented:
This will also move the scrollbar to the bottom.

ListBox1.ItemIndex:=listbox1.Items.Count-1;

Peter
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.