- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Background Worker Class in C#
As the name suggests the Background Worker Class allows you to set a thread continuously running in the background and communicating with the main thread whenever required.
BackgroundWorker makes the implementation of threads in Windows Forms. Intensive tasks need to be done on another thread so the UI does not freeze. It is necessary to post messages and update the user interface when the task is done.
The following properties are used in BackgroundWorker class:
Reference: Microsoft Developer Network (MSDN)
S.No. | Name & Description |
---|---|
1 | CancellationPending A value indicating whether the application has requested cancellation of a background operation. |
2 | CanRaiseEvents Gets a value indicating whether the component can raise an event |
3 | Container Gets the IContainer that contains the Component. |
4 | DesignMode Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.) |
5 | Events Gets the list of event handlers that are attached to this Component. |
6 | IsBusy Gets a value indicating whether the BackgroundWorker is running an asynchronous operation. |
7 | Site Gets or sets the ISite of the Component. |
8 | WorkerReportsProgress Gets or sets a value indicating whether the BackgroundWorker can report progress updates. |
9 | WorkerSupportsCancellation Gets or sets a value indicating whether the BackgroundWorker supports asynchronous cancellation. |
Advertisements