Recent

Author Topic: Non-linear scrollbar scroll speed  (Read 838 times)

Ten_Mile_Hike

  • Jr. Member
  • **
  • Posts: 54
Non-linear scrollbar scroll speed
« on: April 01, 2024, 10:15:57 pm »
Should you ever want to change the speed of scrolling a scrollbar during
a constant scroll this is ONE way to do it. I am not saying this is good
or bad technique. It is just some code for you to peruse .

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ScrollBar1Scroll(Sender:TObject;ScrollCode:TScrollCode; var ScrollPos:Integer);
  2. begin
  3.   With(Sender as TScrollbar)Do LargeChange:= Round(LargeChange*1.06);
  4.   if Sc=ScEndscroll then (Sender as TScrollbar).LargeChange:=10;
  5.  end;

Cheers

 

TinyPortal © 2005-2018