private void Clear_button_Click(object sender, EventArgs e) { Shapes.Clear(); isShapeStart = true; ShapesList.Items.Clear(); tempShape = null; this.Refresh(); }
private void delete_item_Click(object sender, EventArgs e) { while (ShapesList.SelectedIndices.Count > 0) { Shapes.RemoveAt(ShapesList.SelectedIndices[0]); ShapesList.Items.RemoveAt(ShapesList.SelectedIndices[0]); isShapeStart = true; tempShape = null; } Refresh(); }
private void AddShape(Shape shape) { Shapes.Add(shape); ShapesList.Items.Add(shape.AddToList()); }
private void Form1_MouseMove(object sender, MouseEventArgs e) { Point TempPoint = new Point(); if (RCross.Checked) { tempShape = new Cross(e.Location); this.Refresh(); } else if (RLine.Checked) { if (isShapeStart != true) { TempPoint = e.Location; tempShape = new Line(ShapeStart, TempPoint); this.Refresh(); } } else if (RCircle.Checked) { if (isShapeStart != true) { TempPoint = e.Location; tempShape = new Circle(ShapeStart, TempPoint); this.Refresh(); } } else if (RRectangle.Checked) { if (isShapeStart != true) { TempPoint = e.Location; tempShape = new Rec(ShapeStart, TempPoint); this.Refresh(); } } }