private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (MoveButton.Checked && selectedLabel != null) { selectedLabel = null; } if (MoveButton.Checked && selected != null) { selected.UnSetBackLight(); selected = null; } else { csMove = false; } }
private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (MoveButton.Checked) { selectedLabel = SelectLabel(e); double mouseX = cs1.VisualToRealX(e.X); double mouseY = cs1.VisualToRealY(e.Y); clickPoint = new RealPoint(mouseX, mouseY); selected = SelectFigure(clickPoint); if (selected != null) { selected.SetBackLight(); } else if (selectedLabel != null) { // selectedLabel.SetBackLight(); TODO } else { csMove = true; clickPointPixel.X = e.X; clickPointPixel.Y = e.Y; } pictureBox1.Invalidate(); } if (DeleteButton.Checked) { double mouseX = cs1.VisualToRealX(e.X); double mouseY = cs1.VisualToRealY(e.Y); clickPoint = new RealPoint(mouseX, mouseY); selected = SelectFigure(clickPoint); realFigureList.Remove(selected); selected = null; pictureBox1.Invalidate(); } }