C# BackgroundWorker




1. Masukkan BackgroundWorker ke dalam Windows Form. Search BackgroundWorker di Toolbox. Double click pada BackgroundWorker.



2. Invoke Cross-thread

BackgroundWorker - Cross-thread operation not valid


3. Start and Stop BackgroundWorker

private void btnStart_Click(object sender, RoutedEventArgs e) { worker.RunWorkerAsync(); } private void btnCancel_Click(object sender, RoutedEventArgs e) { worker.CancelAsync(); }


Sumber

  1. BackgroundWorker - Cross-thread operation not valid - https://stackoverflow.com/a/39009632/10763264
  2. How to use a BackgroundWorker? - https://stackoverflow.com/a/6481328/10763264
  3. Cancelling the BackgroundWorker - https://www.wpf-tutorial.com/misc/cancelling-the-backgroundworker/

Ulasan

Catatan popular daripada blog ini

SISTEM PENGOPERASIAN KOMPUTER (OS)

JENIS-JENIS SISTEM PENGOPERASIAN KOMPUTER

APA ITU ASCII (AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE) ?