• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

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
0
jeabp
Asked:
jeabp
  • 3
1 Solution
 
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
 
PeterLarsenCommented:
This will also move the scrollbar to the bottom.

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

Peter
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now