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