Progressbar color

Hi to all… yes a newbie
I’m here to ask how i can set different color of a progress bar while value is changing: for example if maximum is 100, greeen under 50, orange under 80 and red from 80 to 100.
I’ve not found this option in the progressbar control.
Thanks in advance

[quote=85942:@Michele Marinai]I’m here to ask how i can set different color of a progress bar while value is changing: for example if maximum is 100, greeen under 50, orange under 80 and red from 80 to 100.
I’ve not found this option in the progressbar control.[/quote]

Good idea, but indeed not part of the properties of the current ProgressBar control.

A custom control can be devised, though, by using for instance two item : the normal ProgressBar with a value of 0 for the background with a border, and a rectangle laid over for the bar. The width of the bar being set as you set the value of the progressBar (width/maximum multiplied by value) and its color as you describe. To get the nice 3D effect of the current ProgressBar would require using a Canvas and manage the color gradient, which is far more involved.

You could also prepare a picture with a gradient of the different colors with, left to right, a transition between green, orange, then red, and place that in a canvas for the bar. As you change the width of the canvas, new portions of the picture appear, creating the effect.

Welcome to Xojo, where ideas are the limit, and imagination the way to transcend the tool :slight_smile:

Think out of the box ! And don’t let mental barriers ruin the day.

Here is the picture I used, over a 284 points wide ProgressBar. Right click and save as…

Progressbars are a productivity sinkhole. One of those things you keep tweaking constantly once you go down that road. :smiley:

The time I learned most about text drawing and placement was doing a progressbar. It was to have rounded corners and the progress also was rounded. There was text vertically and horizontally centered in the bar and when the progress below passed over it the text, originally black, was supposed to change to white where the two met. So there could be single letters half-drawn in one color and half-drawn in another. The rounded progress made easy workarounds less of an option too.

I still tweak that progress bar from time to time. Vertical centering is tricky :smiley:

really thanks to Michel… i’m newbie and i need help… but u have explained very well… like a new user like me need.
Now i try to do

In a way, with faster and faster computers, one would expect them to disappear. Yet they are fascinating enough to capture imagination. I enjoy working on ProgressBars and ProgressWheels.

That is the way to learn. Experiment, don’t be afraid to ask questions, read the documentation, and you wil soon see yourself building more complex programs. Good luck.

Very interesting question. I suggest to read some materials on the ProgressBar control tutorial.

It will surely help a beginner to Xojo to plunge into C# :s

Just realizing now Uchiha above is a spammer account that keeps posting links to his website. Can’t tell if an extremely advanced bot posting semi-related comments or somebody’s most boring job (trawling a developer forum to manually post on-topic spam).

Oh, I did not realize that. Thank you for pointing that out. Hope this is a robot. If it is the work of a human being, he is a remarkable idiot…

Well. This guy seems to have popped up recently in the forum (I found 3 similar plug posts) and he does not know the difference between languages. His site is not finished either… All options on the bottom of his page are inactive. He is not even able to program links in HTML :wink: IQ 60 or less ?