Board index » delphi » TScrollBox not autoscrolling

TScrollBox not autoscrolling

Ok, here's the situation.  I have a TScrollBox on my form.  I
dynamically create the component that will be placed inside the
scrollbox.  Here is an example of my code:

      HistInfo := TLabel.Create(scrbxHistory);
      HistInfo.Name := 'lblHistory' + IntToStr(HistoryRecCount);
      HistInfo.AutoSize := False;
      HistInfo.Left := 4;
      HistInfo.Top := CurY;
      HistInfo.Width := scrbxHistory.Width - 12;
      HistInfo.Caption := 'Example text';
      HistInfo.Anchors := [akLeft, akRight];
      HistInfo.Height := 15;
      HistInfo.Parent := scrbxHistory;
      CurY := CurY + HistInfo.Height + 4;

AutoScroll is set to true on the scrollbox.  However, when the number
of labels exceed the height, no scroll bars are visible.  What am I
doing wrong?

- Scott

 

Re:TScrollBox not autoscrolling


Quote
"Scott" <sbuko...@hotmail.com> wrote in message

news:4157c63e.0201070719.4ab187e4@posting.google.com...

Quote
> Ok, here's the situation.  I have a TScrollBox on my form.  I
> dynamically create the component that will be placed inside the
> scrollbox.  Here is an example of my code:
:
> AutoScroll is set to true on the scrollbox.  However, when the number
> of labels exceed the height, no scroll bars are visible.  What am I
> doing wrong?

Did you check the scrollbox's VertScrollBar.Visible property? If it is
false, then the scrollbar won't appear.

---
Greg Shoom -- gr...@frogware.com
frogware, inc.
Toronto, Ontario, Canada
---

Re:TScrollBox not autoscrolling


The Visible property on both the VertScrollBar and HorzScrollBar is
set to true.  If I slow the process down by putting in a delay or
something else, I can see the scrollbars temporarily, then when it
finishes drawing, they dissappear.

- Scott

Quote
"Greg Shoom" <gregsNOS...@frogware.com> wrote in message <news:jGj_7.89150$Z2.1272056@nnrp1.uunet.ca>...

> Did you check the scrollbox's VertScrollBar.Visible property? If it is
> false, then the scrollbar won't appear.

> ---
> Greg Shoom -- gr...@frogware.com
> frogware, inc.
> Toronto, Ontario, Canada
> ---

Other Threads