Ejemplo n.º 1
0
 private void Clear_button_Click(object sender, EventArgs e)
 {
     Shapes.Clear();
     isShapeStart = true;
     ShapesList.Items.Clear();
     tempShape = null;
     this.Refresh();
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 private void AddShape(Shape shape)
 {
     Shapes.Add(shape);
     ShapesList.Items.Add(shape.AddToList());
 }
Ejemplo n.º 4
0
 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();
         }
     }
 }