Since you want someone to do this for you, have you considered going to a rent-a-coder site and hiring someone? What don't you just create an OnPaint handler and draw whatever you want (or not) in that?

1 solution

Solution 1

Since you add your objects to a list (or two) here is how I would do it.
1) Create an abstract MyShape class, and derive a MyRectangle and MyOval from it. Probably, each should provide code to draw themselves, given an appropriate Graphics object
2) Replace my two lists with a single MyShape list.
3) Add a ReDo MyShape list.
4) When you create a rectangle or oval with the mouse, add it as an appropriate MyShape object to the MyShapes list, and clear the ReDo list. Then Invalidate as you are.
5) Change the Paint handler to draw from the single MyShapes list.
7) To Undo, remove an item from the end of the MyShapes list, and add it to the Redo list. Then Invalidate.
8) To Redo, remove an item from the Redo list, and put it back on the MyShapes list.