private void testPartsButton_Click(object sender, EventArgs e) { // Save the regions on the viewer. testLines.Clear(); foreach (Contour c in imageViewer1.Roi) { testLines.Add(c.Shape); } // Clear the viewer regions and disable the Test Parts button. imageViewer1.Roi.Clear(); DisableRoiSelection(); testPartsButton.Enabled = false; resetButton.Enabled = true; // Enable the timer. timer1.Enabled = true; timer1_Tick(timer1, EventArgs.Empty); }