J-G, from your original post in this thread it seems to me that you are visually representing a triangle "being solved" (including labelled lengths and angles).
Are you "storing" this data? For example like:
type
TTriangle = record
pts : array [1..3] of TPoint;
lengths : array [1..3] of double;
angles : array [1..3] of double;
end;
If you do this, then whenever the OnPaint event is triggered, you can use this information to (re)draw the triangle. This should mean that the graphics would never disappear - if another window covers the form or whatever.
cheers
S.
You are quite correct @Speter - as far as the object of the program is concerned - and Yes I am storing the data, though not in a 'Record' as your example shows, similar but since my programming style is 'organic' and 'iterative' I seldom re-visit code to make it more efficient

I do actually have the Side and Angle dimensions stored in arrays of record but not under the umbrerella of 'Triangle' :
S_Dims : array[1..5] of record
Dim : string;
Size : single;
Pix : word;
Rot : word;
end;
A_Dims : array[1..3] of Record
Dim : string;
Size : single;
Rot : word;
end;
You may now be wondering why I have 5 'sides' - the extra 2 are Width & Height which in the case of anything other than a 'Right Triangle' may well be different from A, B or C - for scaling within the display area those figures are vital.
The original program was intended to simply solve triangles given any three of the six potential dimensions and just returning all of them. Only later when discussing it with my grandson did I consider adding a 'visual' aspect. This was initially as 6 pre-drawn images.
Adding a complete list of the various 'functions' (Sin, Cos, Tan) for all three angles came much later - though I had previously written a separate program to calculate such, given any angle in Degrees or Radians - and that included Cotan, Secant, Cosec plus Astronomical equivalent in days,hours, minutes & seconds !!
Only laterly have I come to drop the pre-drawn images to show a more accurate representation of the triangle.
As far as the image being cleared, this only happens when I drag the main program window outside the screen area, dragging another window of any kind over the top of my main window leaves the image 'as is'.
To answer @Jamie's question - - - since there are only three 'points', I didn't even concider using 'DrawPolly' which may well be more efficient (though I would still have to calculate the same number of points) but maybe not as 'flexible'. From what I have read, DrawPolly just uses the current pen colour/size, whereas in my use case it may well be more informative to have each side of the triangle a different colour/size. I haven't used that as yet but it is an option.