public partial class FormWithTimer : Form { Timer timer = new Timer(); public FormWithTimer() { InitializeComponent(); timer.Tick += new EventHandler(timer_Tick); // Every Time timer ticks, timer_Tick will be called timer.Interval = (1000) * (1); // Timer will tick every second timer.Enabled = true; // Enable the timer timer.Start(); // Start the timer } void timer_Tick(object sender, EventArgs e) { SendCommand("TEMP"); } }
void timer_Tick(object sender, EventArgs e) { SendCommand("TEMP"); timer.Stop(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)