示例#1
0
        private void Form1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (currShape == shapeType.Circle)
            {
                Circle circle = new Circle(e.X, e.Y, currColor, 15);
                shapes.Add(circle);
                Graphics g = this.CreateGraphics();
                circle.Draw(g);
            }
            else if (currShape == shapeType.Square)
            {
                Square square = new Square(e.X, e.Y, currColor, 60, 50);
                shapes.Add(square);
                Graphics g = this.CreateGraphics();
                square.Draw(g);
            }

            Invalidate();
        }