I am rendering stuff with a Graphics-object in a picturebox inside the Paint-event for that picturebox.
void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.FillEllipse(color, x, ...);
etc etc......
}
Everything works fine but suddenly the picturebox turns white and displays a big red X. If i look in the output-window I can see that there is an exception there, often an OverflowException or NullPointerException.
Is there any way to find from where that exception came? The debugger doesn't break like it does everywhere else when you get an exception.