Windows Form

Change the Color of ProgressBar in C#

In this article,  We will create a simple Login Form and we will change the color of the ProgressBar.

If entered password lower then 5 characters, we will set the color of progress bar as red . And if entered chars are between 5 And 8 we will set the color of progressbar is yellow. And once for all if the entered chars are higher then 8 chars, we will set the progress bar color as Green.

Output:

Step 1: Form Design.

Step 2:  Program.cs in Solution Explorer.

 

Step 3: Properties of ProgressBar1

 

Step 4:  C# Code (txtPass_TextChanged)

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.