Author: Tomas Rutkauskas How to create a scrollbox that lets you disable automatic scrolling Answer: 1 unit MyScrollBox; 2 3 interface 4 5 uses 6 SysUtils, Classes, Controls, Forms; 7 8 type 9 TMyScrollBox = class(TScrollBox) 10 private 11 FEnableScrollInView: Boolean; 12 protected 13 procedure AutoScrollInView(AControl: TControl); override; 14 public 15 constructor Create(AOwner: TComponent); override; 16 published 17 property EnableScrollInView: Boolean read FEnableScrollInView 18 write FEnableScrollInView default True; 19 end; 20 21 procedure register; 22 23 implementation 24 25 procedure register; 26 begin 27 RegisterComponents('Samples', [TMyScrollBox]); 28 end; 29 30 procedure TMyScrollBox.AutoScrollInView(AControl: TControl); 31 begin 32 if FEnableScrollInView then 33 inherited AutoScrollInView(AControl); 34 end; 35 36 constructor TMyScrollBox.Create(AOwner: TComponent); 37 begin 38 inherited Create(AOwner); 39 FEnableScrollInView := True; 40 end; 41 42 end.