Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ScrollPanel and vertical bar
Thu, Aug 29 2024 4:52 AMPermanent Link

Artur2024

Avatar

Is it possible to read the position of the vertical bar in ScrollPanel? I would like to always move another panel on top of the panel so that it is always visible at the top edge.
Fri, Aug 30 2024 10:22 PMPermanent Link

erickengelke

Avatar

Artur2024 wrote:

> Is it possible to read the position of the vertical bar in ScrollPanel? I would like to always move another panel on top of the panel so that it is always visible at the top edge.

Sure, you can the the ScrollPanel's OnScroll handler to do stuff and read the ScrollTop value.  It's zero when at the top, and larger when you've scrolled down.

procedure TForm1.ScrollPanel1Scroll(Sender: TObject);
begin
    label1.Caption := IntToStr( scrollpanel1.ScrollTop );
end;
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Thu, Sep 5 2024 4:49 PMPermanent Link

Artur2024

Avatar

procedure TForm1.ScrollPanel1Scroll(Sender: TObject);
begin
    label1.Caption := IntToStr( scrollpanel1.ScrollTop );
end;


Works perfect. Thank you very much Smile
Image