TScrollBox and TCustomControl both descend from TWinControl . TScrollBox and TScrollingWinControl add scrollbars, while TCustomControl adds canvas. To get what you want, you can either add the canvas to TScrollingWinControl or add scrollbars to TCustomControl .
Compare the definitions of the two classes (respectively in Forms.pas and Controls.pas), and it should be clear which functions will be easier to duplicate in your descendant. TCustomControl adds three simple methods, implemented in approximately 40 lines of code. Write a descendant of TScrollingWinControl and copy the methods and properties from TCustomControl .
source share