I have a little probelm...
When I draw some graphics on a form in canvas it dissapears after minimizing application...
Only draw inside OnPaint events.
To manually trigger a redraw, call Invalidate or Refresh on a control or on the form.
If you don't want to have to explicitly draw everything again when the canvas needs refreshed, a common method is to use a buffer. I'm going to assume you're using the main form's canvas, but this applies just as well to a paintbox or any other on-screen canvas. Create a TBitmap the same size as the form's canvas, do all your drawing on the bitmap's canvas. In the OnPaint for the form's canvas just copy the bitmap's canvas to the form's canvas. Every time you draw to the bitmap's canvas you'll need to force the form to update or write an extra procedure that only updates changed areas.
One way to reduce the clutter of creating all these Bitmap objects by hand and making sure they're painted and stuff is by simply using a TImage. It's a visual component to display bitmaps. You don't really *have* to load a bitmap from a file, you can also start from an empty one and draw on its canvas.
Dave Van den Eynde
Fog Creek Home