private void StopButton_Click(object sender, EventArgs e) { timer1.Stop(); timer2.Stop(); LogOffTimer.Stop(); SchoolIDTimer.Stop(); }
private void SchoolIDTimer_Tick(object sender, EventArgs e) { Win32.POINT p4 = new Win32.POINT(); p4.x = Convert.ToInt16(SIDX.Text); //x coordinate taken from the txtbox p4.y = Convert.ToInt16(SIDY.Text); //y coordinate taken from the txtbox Win32.ClientToScreen(this.Handle, ref p4); Win32.SetCursorPos(p4.x, p4.y); DoMouseClick(p4.x, p4.y); SendKeys.Send(SIDTxtBox.Text); SendKeys.Send("{ENTER}"); SchoolIDTimer.Stop(); var userSetDelay2 = delayValue2.Value; //gets the delay value the user sets using the numericUpDown control timer2.Interval = Convert.ToInt32(userSetDelay2) * 1000; //multiply by 1000 because this is supposed to be in miliseconds but we //use seconds on the numericUpDown to make it easier for the user. timer2.Start(); }