For example, with a boolean for red/green ellipse (FillEllipse for filled ellipse) =>
private bool bOK = false;
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
Rectangle rect = new Rectangle(0, 0, pictureBox1.ClientSize.Width - 1, pictureBox1.ClientSize.Height - 1);
System.Drawing.Color color = (bOK ? System.Drawing.Color.Green : System.Drawing.Color.Red);
using (System.Drawing.Brush brush = new SolidBrush(color))
{
e.Graphics.FillEllipse(brush, rect);
}
}
and in the click event of a button =>
bOK = !bOK;
pictureBox1.Invalidate();