Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
.NET Framework
Problemi con System.Threading.Timer
mercoledì 03 maggio 2006 - 09.40
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
lcabrin
Profilo
| Newbie
27
messaggi | Data Invio:
mer 3 mag 2006 - 09:40
Ciao a tutti,
scusate la mia inesperienza con i thread, ma ho un problema che devo risolvere. Ho il seguente codice
private void Form1_Load(object sender, System.EventArgs e)
{
// Create the delegate that invokes methods for the timer.
TimerCallback timerDelegate = new TimerCallback(CheckStatus);
// Create a timer that waits one second, then invokes every second.
System.Threading.Timer timer = new System.Threading.Timer(timerDelegate, null,4000, 1000);
}
private void CheckStatus(Object sender)
{
this.lblTimer.Text = Convert.ToString(Convert.ToInt32(this.lblTimer.Text) + 1);
}
private void btnStart_Click(object sender, System.EventArgs e)
{
for(int i = 0; i <= 1000; i++)
{
this.txtTesto.Text += i + "\n";
}
}
dovrei poter far continuare a scorrete il tempo in secondo anche se ci sono delle elaborazioni come il ciclo di cui sopra...
Come posso fare??
Ciao e garzie a tutti
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !