// Initialize and start the timer oServiceTimer = new System.Timers.Timer(); // create your timer object oServiceTimer.Elapsed += new System.Timers.ElapsedEventHandler(oServiceTimer_Elapsed); // add the method to run when the elapsed event fires oServiceTimer.Interval = 1000 * 15; // 15 sec intervals oServiceTimer.AutoReset = true; // if this is false the timer will only fire once oServiceTimer.Start(); // Start the timer oServiceTimer_Elapsed(this,null); // Call the oServiceTimer_Elapsed event manually so we don't have to wait for the interval private void oServiceTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { MessageBox.Show("I fired"); }Hope this helps you get started.
> >this.tmrSQLConnection.Enabled = true; >this.tmrSQLConnection.Start(); > lResult = MyTestValues.TestServer(this.txtSQLUserID.Text.Trim(),this.txtSQLPassword.Text.Trim(),this.txtServerName.Text.Trim()); >this.tmrSQLConnection.Stop(); >this.tmrSQLConnection.Enabled = false; > > > private void tmrSQLConnection_Tick(object sender, System.EventArgs e) > { > int TimeValue = 0; > TimeValue = (this.tmrSQLConnection.Interval/1000); > this.lblStatus.Text = "Time Remaining (" + TimeValue.ToString() + ")"; > this.lblStatus.Update(); > } > >