Actually, the ellipses get drawn, but immediately erased by your last statement:
The correct way, however is not to draw at all in the MouseUp event. MouseUp should confine itself to storing the necessary data and calling
The drawing then will happen in
. Subscribe that method to pictureBox1's
event. In that method, do as you tried in your
method but without Refresh and Invalidate.
The Paint method will have a
as second parameter. Use the
object rather than creating a new one.
1. You don't need a PictureBox to draw on. That can be achieved with any Control-derived class. Use a PictureBox if you need its ability to show existing pictures.
2. Storing ellipse co-ordinates in a string is not the way to go, use a List<Rectangle>