if you have the VCL source look at the way TCustomControl is implementing
its canvas and the Paint mechanism. That is about what you would have to
add to a descendent of TScrollbox to give it a canvas: a private field that
holds the canvas, a constructor that creates it, a destructor that frees
it, a handler for WM_PAINT that sets up the canvas and calls the Paint
method etc..
Another option would be to fill the scrollbox with a TCustomControl
descendent with Align := alClient and publish that controls Canvas in a
Canvas property of the parent scrollbox.
Peter Below (TeamB) 10011...@compuserve.com)
Brian Lowe
Acro Technology Inc.
(formerly Beond Technology Corp.)
Del Gutierrez wrote:
>
> How ould I accomplish adding a Canvas property to the TScrollBox
> control?
> TIA, Del G.
Peter,
I did indeed check out the source of the VCL and in particular, the
source for TCumstomControl. To a derived TScollBox, I added a FCanvas
property, a WMPaint message handler and the paint method.
Unfortunately, that is what prompted my question since every time I try
to draw to that Canvas, I get the message 'Canvas does not allow
drawing.' (Verbatim from Delphi 3.01.) Now what?
TIA, Del G.
P.S. As a quick workaround, I'll try a TCustomControl critter with
Align := alClient. Thanks, Del G.