Good morning all,
Bit of mind boggler this.
I have the following little progress bar thing:
The bar between the two numbers (Stage1 and Stage2, from left to right) is currently centred using the following code:
x = (Stage1.X + Stage1.Width) + (Stage1.Width / 2)
width = Stage2.X - (Stage1.X + Stage1.Width) - (Stage1.Width)
Now this means that if I resize the control, the bar adjusts automatically, like below:
But you can also see that the bar becomes too short to be useful/look any good. So I think I need the width of the bar to be a percentage of the gap between Stage1 and Stage2, and for the X to continue to centre it.
Honestly I'm at a loss on how to do this. Is there anyone better at maths that can help here? Cheers!
Amazing! Thank you!
Hi @EpicTriffid ,
With the below you'll have a 10% / 80% / 10% ratio which you adjust by changing the fractions:
X = (Stage1.X + Stage1.Width)+((Stage2.X - (Stage1.X + Stage1.Width)) * .1)
Width = (Stage2.X - (Stage1.X + Stage1.Width)) * .8
On top of that you may want to set the Visible property so the control disappears below a certain threshold (in the below example 25):
Visible = Self.Width > 25
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional