public Toolbox(Focuser f) { MyFocuser = f; InitializeComponent(); t = new System.Timers.Timer(500); //500毫秒执行一次; t.Elapsed += new System.Timers.ElapsedEventHandler(TimerEvent); //到达时间的时候执行事件; t.AutoReset = true; //设置是执行一次(false)还是一直执行(true); t.Enabled = true; //是否执行System.Timers.Timer.Elapsed事件; }
private void textBoxStepSize_KeyPress(object sender, KeyPressEventArgs e) { Focuser.OnlyEnterPlusNumber(sender, e); }
private void textBoxMaxStep_KeyPress(object sender, KeyPressEventArgs e) { Focuser.OnlyEnterPlusInt(sender, e); }
private void textBoxStepPerDeg_KeyPress(object sender, KeyPressEventArgs e) { Focuser.OnlyEnterNumber(sender, e); }
private void textBoxPosition_KeyPress(object sender, KeyPressEventArgs e) { Focuser.OnlyEnterInt(sender, e); }