private void AddShape(Shape AddedShape) { if (AddedShape.IsNotDegenerate) { Shapes.Add(AddedShape); ShapesList.Items.Add(AddedShape.DescriptionString); } }
private void MainCanvas_MouseMove(object sender, MouseEventArgs e) { int ind_TEMP = SelectMatching(Shapes,e.Location); if (ind_TEMP > -1) toolTip1.SetToolTip(MainCanvas, Convert.ToString(ShapesList.Items[ind_TEMP])); else toolTip1.SetToolTip(MainCanvas,""); if (IsShapeStart) { this.Text = Convert.ToString(e.X) + " - " + Convert.ToString(e.Y); TempShape = new Cross(e.Location); } else { if (radioButton_Line.Checked) { TempShape = new Line(ShapeStart, e.Location); } if (radioButton_Circle.Checked) { TempShape = new Circle(ShapeStart, e.Location); } if (radioButton_Rect.Checked) { TempShape = new Rect(ShapeStart, e.Location); } } MainCanvas.Invalidate(); }
private void MainCanvas_MouseLeave(object sender, EventArgs e) { TempShape = null; MainCanvas.Invalidate(); }