You do not override the OnPaint() method. You just subscribe to the Paint event, so you shouldn't call base.OnPaint() .
You should (could) call base.OnPaint() only when overriding the OnPaint() method of the form:
protected override OnPaint(PaintEventArgs e) { base.OnPaint(e);
The OnPaint method for Windows Forms controls actually fires the Paint event of the control and also draws the control surface. By calling the base OnPaint method in the Paint event handler, you really tell the form to call the Paint handler again and again, and so you will end up in an infinite loop, and therefore a StackOverflowException .
When you override the OnPaint method of a control, you usually need to call the base method so that the control itself executes and also calls event handlers that subscribe to the Paint event. If you do not call the base method, some aspects of the control will not be drawn, and the event handler will not be called.
source share