Recent

Author Topic: ScrollBox Scrolling using different control ??  (Read 2529 times)

Josh

  • Hero Member
  • *****
  • Posts: 1270
ScrollBox Scrolling using different control ??
« on: March 23, 2018, 03:10:14 pm »
Hi

Hope this is somwthing silly that I have missed.

I am playing around with a Tscrollbox, but want to use a different scroll control; something lile attscroll control. as it themes much better than the native one.

If I control the scrollbox.verticalscroll.position parameter with the other control; it will only scroll the scrollbox if the scrollbox own scrollbars are visible.
So how to scroll a scrollbox that does not have the scrollbars visible?

attached program using standard controls, a progress bar for scrolling.

I suspect It's something silly I have missed.

Thanks
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

ASerge

  • Hero Member
  • *****
  • Posts: 2212
Re: ScrollBox Scrolling using different control ??
« Reply #1 on: March 23, 2018, 06:27:39 pm »
If you do not need a scrollbar, do not use the TScrollBox. The usual TPanel is also suitable:
Code: Pascal  [Select][+][-]
  1. ...
  2.   private
  3.     FPrevPos: Integer;
  4. ...
  5. procedure TForm1.TrackBar1Change(Sender: TObject);
  6. var
  7.   NewPos: Integer;
  8. begin
  9.   NewPos := TrackBar1.Position;
  10.   Panel1.ScrollBy(0, NewPos - FPrevPos);
  11.   FPrevPos := NewPos;
  12. end;

Josh

  • Hero Member
  • *****
  • Posts: 1270
Re: ScrollBox Scrolling using different control ??
« Reply #2 on: March 23, 2018, 09:55:48 pm »
Hi ASerge.

I have come to the same conclusion; using panel within panel; works very well and smooth with doublebuffer on form and panels.

Thanks
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018