I found something that I do not really get:
protected override void OnPaint(PaintEventArgs e)
{
DrawChar(e.Graphics);
base.OnPaint(e);
}
void DrawChar(Graphics g)
{
if (body != null)
{
g.DrawImage(body, X, Y);
}
}
Suppose the "body" is empty - If I remove the condition in the DrawChar, the program never draws anything and I found out that the onPaint is not even raised anymore (e.g. when resizing or minimazing and restoring the window).
EDIT: The point is - if the DrawImage fails (which you do not know from the debugger, it simply does not draw the image e.g. when the Image is null), the OnPaint event in the application ceases to be raised.