Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I need to know how to create a bar that will track the quantity of items in my table in mysql..... such that it shows green when its above 50% and red when its below... any ideas... am doing it in c#
Posted
Updated 25-Apr-12 23:33pm
v2

the color of progressbar doesn't change because it follows operating system's theme color.
to modify color u need to remove this line from Program.cs file
C#
//EnableVisualStyles() applies color and style of operating system to ur controls.
Application.EnableVisualStyles();


Note:-this wud remove operating system theme styles and colors of other elements in your project


update the progressbar from another thread.

to keep it red below 50% u need to set backcolor to red for every change in value.

hope this helped u :)
 
Share this answer
 
Comments
Mantu Singh 28-Apr-12 10:45am    
Thanks for guidance .......
Some complex out of way methods were given on various sites this one simple enough........
This didn't help FALILA may be but helped me

Regards;
Try a ProgressBar[^].
 
Share this answer
 
Comments
Mantu Singh 26-Apr-12 7:23am    
Dear sir;
I tried to change color of progress bar other than default green once for a project but after lot of hassles couldn't do it even through back color property....

Some help will be greatly appreciated as how to achieve this effect
Regards;
Richard MacCutchan 26-Apr-12 7:42am    
Why not spend some time reading the documentation for the control, and create a test program to help work out exactly how to utilise the features that you need.
Richard MacCutchan 26-Apr-12 7:43am    
You could also search the CodeProject articles section to see if anyone has written about this control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900