Ejemplo n.º 1
0
        private void DrawPanel_MouseClick(object sender, MouseEventArgs e)
        {
            var figure = new FigureClass
            {
                x           = e.X,
                y           = e.Y,
                borderColor = _borderColor,
                fillColor   = _fillColor,
                size        = _size
            };

            switch (_figure)
            {
            case Figure.Circle:
                _circleCoords.Add(figure);
                break;

            case Figure.Square:
                _squaresCoords.Add(figure);
                break;

            case Figure.Triangle:
                _triangesCoords.Add(figure);
                break;

            default:
                break;
            }

            DrawPanel.Update();
            DrawPanel.Refresh();
        }
Ejemplo n.º 2
0
        private void ClearBtn_Click(object sender, EventArgs e)
        {
            _circleCoords.Clear();
            _squaresCoords.Clear();
            _triangesCoords.Clear();

            DrawPanel.Update();
            DrawPanel.Refresh();
        }
Ejemplo n.º 3
0
 private void RefreshPanel(object sender, EventArgs e)
 {
     DrawPanel.Invalidate();
     DrawPanel.Update();
 }