private void MainScreen_MouseDown(object sender, MouseEventArgs e) { if (Cross.Checked) { tempShape = new Cross(e.X, e.Y); AddShape(tempShape); tempShape = null; this.Refresh(); } if (Line.Checked) { IsShapeStart = !IsShapeStart; if (IsShapeStart) { Shapestart = e.Location; } else { AddShape(new Line(Shapestart, e.Location)); } } this.Refresh(); }
private void MainScreen_MouseMove(object sender, MouseEventArgs e) { Point TempPoint = e.Location; this.Refresh(); if (Cross.Checked) { tempShape = new Cross(e.X, e.Y); this.Refresh(); } else if (Line.Checked) { if (!IsShapeStart) return; tempShape = new Line(Shapestart, TempPoint); this.Refresh(); } }
private void AddShape(Shape shape) { Shapes.Add(shape); ShapesList.Items.Add(tempShape.Info()); }