I have created a component that has a paint override on the canvas and i would like to set a limit on minimum width and height. The scrollbar should appear at the side when the Width Or Height is less then the limit just like a scrollbox and can be scroll also.
i choose TCustomControl cause i paint and less flicker when double buffered.
any idea or better solution?
TScrollBoxandTCustomControlboth descend fromTWinControl.TScrollBoxandTScrollingWinControladd scroll bars, whereasTCustomControladds a canvas. To get what you want, you can either add a canvas to aTScrollingWinControl, or you can add scroll bars to aTCustomControl.Compare the definitions of the two classes (in Forms.pas and Controls.pas, respectively), and it should be clear which one’s features will be easier to duplicate in your descendant.
TCustomControladds three simple methods, implemented in about 40 lines of code. Write aTScrollingWinControldescendant and copy the methods and properties fromTCustomControlinto it.