I am afraid you are following the wrong concept. You seem to draw on the form's canvas upon mouse clicks, mouse drag operations etc. The problem is that the operating system may command the form at any time to redraw itself, for example because the user drags another form over your form. In this case the mouse operations are long gone, and your painting will be erased because the form does not remember your drawing.
If you want a persistent drawing you must store what's to be drawin and you must draw this only in the OnPaint event of the form (or panel, or paintbox etc). This way the form (panel, paintbox) knows what to do when the OS requests repainting.
One thing that you could do is to use a TBitmap to buffer your painting operations, and to use the OnPaint event to draw the bitmap.
Of course, you must force the control to repaint itself after each drawing step if you want to see a live change. This can be done by calling the control's Invalidate method.
I am attaching a very simple example which creates a bitmap and paints it on the canvas of a panel - I selected a paintbox rather than the form because it is easier to define a distinct drawing area.