Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
Windows Show Desktop hace que los elementos de WinForms dejen de actualizarse

¿Hay alguna forma sencilla de que los elementos de un formulario sigan actualizándose incluso después de hacer clic en Mostrar escritorio de Windows? El siguiente código actualiza el valor en textBox1 hasta que hago clic en Windows Show Desktop (Windows 10: haga clic en la parte inferior derecha de la pantalla). Prefiero no usar Application.DoEvents() .

 void Button1Click(object sender, EventArgs e) { int n = 0; while(true) { textBox1.Text = n++.ToString(); textBox1.Refresh(); Update(); // Application.DoEvents(); Thread.Sleep(200); } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El uso de Thread.Sleep bloquea el subproceso actual (subproceso de interfaz de usuario); puedes arreglarlo así:

 private async void button1_Click(object sender, EventArgs e) { int n = 0; while (true) { textBox1.Text = n++.ToString(); await Task.Delay(200); } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!