SORU
19 Mart 2009, PERŞEMBE


C başka bir iş parçacığı GUI güncelleştirme#?

Başka bir iş parçacığı Label güncelleştirmek için en kolay yolu nedir?

Bu başka bir iş parçacığı başladım thread1 Form (thread2) var. thread2 thread2 mevcut durum Form Labelbir iş için. güncellemek istiyorum bazı dosyaları işlerken

Bunu nasıl yapabilirim?

CEVAP
19 Mart 2009, PERŞEMBE


basityol isimsiz bir yöntemdir

///...blah blah updating files
string newText = "abc"; // running on worker thread
this.Invoke((MethodInvoker)delegate {
    someLabel.Text = newText; // runs on UI thread
});
///...blah blah more updating files

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Caroline Saquet

    Caroline Saq

    1 EKİM 2011
  • MW Technology

    MW Technolog

    28 EKİM 2009
  • TechXCentral

    TechXCentral

    12 Temmuz 2011