c# drawing, circle goes outside form
See the question and my original answer on StackOverflowIt's because you use the Window size, not the "client" size. Just replace your code by this:
gr.DrawEllipse(ellipse_pen, this.ClientRectangle);
The client area of a control is the bounds of the control, minus the nonclient elements such as scroll bars, borders, title bars, and menus.