Beispiel #1
0
 private void textCountsPerUnit_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Enter)
     {
         try
         {
             double countsPerUnit = Convert.ToDouble(textCountsPerUnit.Text);
             if (countsPerUnit > 0)
             {
                 axis.SetUnit("mm", countsPerUnit);
             }
         }
         catch (Exception ex)
         {
             DisplayError("Set Unit error: " + ex.Message);
         }
     }
 }