I'm learn various features of C# and I am trying to create a Windows Forms program in which you draw a rectangle.
I understand that onpaint method supposed to override the paint method and overriding helps if you wish to provide a method to the parent class.
In what cases should you use the OnPaint handler
protected override void OnPaint(PaintEventArgs e)
instead of the regular paint handler
private void Form1_Paint(object sender, PaintEventArgs e)
In another way of asking is what methods do the onpaint method provide that the form1_paint couldn't?