SlideShare a Scribd company logo
Submitted by: MUHAMMAD USMAN
SALEEM (543)
Submitted to: ZAHID ASLAM & WHOLE CLASS
Progress-Bar
INTRODUCTION
Progress-Bar indicates visually the progress of
an operation. It is best used on a long-running
computation or task. And the Background-Worker
is often used to perform that task—it does not
block the interface.
Continue...
Example: Please add a Progress-Bar control to
your Windows-Forms program by double-clicking
on the Progress Bar entry in the Toolbox. For this
example, we also need a Background Worker—
add one and then create the event handlers
required.
Note : We need the Load event handler, the Do
Work event handler, and the Progress Changed
event handler.
Example that uses Progress Bar
and Background Worker: C#
using System.ComponentModel;
using System.Threading;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Continue...
private void Form1_Load(object sender, System.EventArgs e)
{
// Start the BackgroundWorker.
backgroundWorker1.RunWorkerAsync();
}
private void backgroundWorker1_DoWork(object sender,
DoWorkEventArgs e)
{
for (int i = 1; i <= 100; i++)
{
// Wait 100 milliseconds.
Thread.Sleep(100);
// Report progress. backgroundWorker1.
ReportProgress(i);
}
Continue…
private void backgroundWorker1_ProgressChanged(object
sender, ProgressChangedEventArgs e)
{
// Change the value of the ProgressBar to the
BackgroundWorker progress.
progressBar1.Value = e.ProgressPercentage;
// Set the text.
this.Text = e.ProgressPercentage.ToString();
}
}
}
Starting the background task
In the Form1_Load event handler, please add a
method call to the Run-Worker-Async method on
the Background-Worker instance. This will create
a thread and the Do-Work method will begin.
METHOD
Inside the Do-Work event handler, we loop
over the numbers 1 through 100. At each
iteration, we wait one-tenth of a second. Then, we
call the Report-Progress method on the
Background-Worker instance.
And:
In Progress-Changed, we set the value of the
Progress-Bar to the Progress-Percentage
property of the Progress-Changed-EventArgs
argument.
PROPERTY
Color
One of the useful properties on the Progress-Bar
is the Fore-Color property. This can be set to a
Color value to change the color of the bar itself
that is drawn on the screen. It is often better to
use the default color.
Note:In this screenshot, we see a yellow bar
instead of the default blue bar. This is likely a bad
design decision.
Summary
The Progress-Bar control is often used in
conjunction with a threading mechanism such as
Background-Worker. With its many options, the
Progress-Bar makes a suitable widget for letting
your users know the application is still active.
THANKS

More Related Content

What's hot

Alice3 Introduction
Alice3 IntroductionAlice3 Introduction
Alice3 Introduction
elketeaches
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
hikrittiwit
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Gamee Nopnop
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
iceana
 
Introduction to programming what is programming it deal with the study of com...
Introduction to programming what is programming it deal with the study of com...Introduction to programming what is programming it deal with the study of com...
Introduction to programming what is programming it deal with the study of com...
Thampaphon Thianwongsagon
 
Introduction to-programming (1)
Introduction to-programming (1)Introduction to-programming (1)
Introduction to-programming (1)
Nattaporn Bunmak
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
PTtp WgWt
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
pakhpoom00110
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
Nattaporn Bunmak
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
fahsai imjai
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
khwan_thananda
 
Introduction to programming
Introduction  to programming	Introduction  to programming
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
POom'z RCz
 
Introduction to programming
Introduction  to programmingIntroduction  to programming
Introduction to programming
Gamee Nopnop
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
Nittaya Thongpoon
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
Gamee Nopnop
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
sennysns
 

What's hot (18)

Alice3 Introduction
Alice3 IntroductionAlice3 Introduction
Alice3 Introduction
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to programming what is programming it deal with the study of com...
Introduction to programming what is programming it deal with the study of com...Introduction to programming what is programming it deal with the study of com...
Introduction to programming what is programming it deal with the study of com...
 
Introduction to-programming (1)
Introduction to-programming (1)Introduction to-programming (1)
Introduction to-programming (1)
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to programming
Introduction  to programming	Introduction  to programming
Introduction to programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to programming
Introduction  to programmingIntroduction  to programming
Introduction to programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 

Similar to Progress bar

Flow based programming in golang
Flow based programming in golangFlow based programming in golang
Flow based programming in golang
Anton Stepanenko
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
Klaus Hofeditz
 
Abap objects in action
Abap objects in actionAbap objects in action
Abap objects in action
Faina Fridman
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
Information Technology Center
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c language
kamalbeydoun
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
David Barreto
 
IBM Business Automation Workflow
IBM Business Automation WorkflowIBM Business Automation Workflow
IBM Business Automation Workflow
Mohammed El Rafie Tarabay
 
Step by step lsmw tutorial
Step by step lsmw tutorialStep by step lsmw tutorial
Step by step lsmw tutorial
raonivaz
 
How To Use IO Monads in Scala?
 How To Use IO Monads in Scala? How To Use IO Monads in Scala?
How To Use IO Monads in Scala?
Knoldus Inc.
 
Java script
Java scriptJava script
Java script
fahhadalghamdi
 
03b loops
03b   loops03b   loops
03b loops
Manzoor ALam
 
Book management system
Book management systemBook management system
Book management system
SHARDA SHARAN
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
Huu Bang Le Phan
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
Pantech ProLabs India Pvt Ltd
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonf
Nataliya Patsovska
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
Mario Fusco
 
Roamer World
Roamer WorldRoamer World
Roamer World
Malcolm Wilson
 
Event handling63
Event handling63Event handling63
Event handling63
myrajendra
 
Uber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep LearningUber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep Learning
inside-BigData.com
 
Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 

Similar to Progress bar (20)

Flow based programming in golang
Flow based programming in golangFlow based programming in golang
Flow based programming in golang
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
 
Abap objects in action
Abap objects in actionAbap objects in action
Abap objects in action
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c language
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
IBM Business Automation Workflow
IBM Business Automation WorkflowIBM Business Automation Workflow
IBM Business Automation Workflow
 
Step by step lsmw tutorial
Step by step lsmw tutorialStep by step lsmw tutorial
Step by step lsmw tutorial
 
How To Use IO Monads in Scala?
 How To Use IO Monads in Scala? How To Use IO Monads in Scala?
How To Use IO Monads in Scala?
 
Java script
Java scriptJava script
Java script
 
03b loops
03b   loops03b   loops
03b loops
 
Book management system
Book management systemBook management system
Book management system
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonf
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
 
Roamer World
Roamer WorldRoamer World
Roamer World
 
Event handling63
Event handling63Event handling63
Event handling63
 
Uber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep LearningUber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep Learning
 
Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdf
 

Recently uploaded

How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 

Progress bar

  • 1. Submitted by: MUHAMMAD USMAN SALEEM (543) Submitted to: ZAHID ASLAM & WHOLE CLASS Progress-Bar
  • 2. INTRODUCTION Progress-Bar indicates visually the progress of an operation. It is best used on a long-running computation or task. And the Background-Worker is often used to perform that task—it does not block the interface.
  • 3. Continue... Example: Please add a Progress-Bar control to your Windows-Forms program by double-clicking on the Progress Bar entry in the Toolbox. For this example, we also need a Background Worker— add one and then create the event handlers required. Note : We need the Load event handler, the Do Work event handler, and the Progress Changed event handler.
  • 4. Example that uses Progress Bar and Background Worker: C# using System.ComponentModel; using System.Threading; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
  • 5. Continue... private void Form1_Load(object sender, System.EventArgs e) { // Start the BackgroundWorker. backgroundWorker1.RunWorkerAsync(); } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { for (int i = 1; i <= 100; i++) { // Wait 100 milliseconds. Thread.Sleep(100); // Report progress. backgroundWorker1. ReportProgress(i); }
  • 6. Continue… private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { // Change the value of the ProgressBar to the BackgroundWorker progress. progressBar1.Value = e.ProgressPercentage; // Set the text. this.Text = e.ProgressPercentage.ToString(); } } }
  • 7. Starting the background task In the Form1_Load event handler, please add a method call to the Run-Worker-Async method on the Background-Worker instance. This will create a thread and the Do-Work method will begin.
  • 8. METHOD Inside the Do-Work event handler, we loop over the numbers 1 through 100. At each iteration, we wait one-tenth of a second. Then, we call the Report-Progress method on the Background-Worker instance. And: In Progress-Changed, we set the value of the Progress-Bar to the Progress-Percentage property of the Progress-Changed-EventArgs argument.
  • 9. PROPERTY Color One of the useful properties on the Progress-Bar is the Fore-Color property. This can be set to a Color value to change the color of the bar itself that is drawn on the screen. It is often better to use the default color. Note:In this screenshot, we see a yellow bar instead of the default blue bar. This is likely a bad design decision.
  • 10. Summary The Progress-Bar control is often used in conjunction with a threading mechanism such as Background-Worker. With its many options, the Progress-Bar makes a suitable widget for letting your users know the application is still active.