private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (MoveButton.Checked) { SelectLabel(e); selected = SelectFigure(e); if (selected != null) { Text = selected.ToString(); } else { Text = "null"; } if (selected != null) { selected.SetBackLight(); } pictureBox1.Invalidate(); } if (DeleteButton.Checked) { selected = SelectFigure(e); realFigureList.Remove(selected); selected = null; pictureBox1.Invalidate(); } }
private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { // deselect label if (MoveButton.Checked && selectedLabel != null) { selectedLabel = null; } // deselect figure if (MoveButton.Checked && selected != null) { selected.UnSetBackLight(); selected = null; } }