Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3762

Change rectangle size but aligned to the bottom not top

$
0
0

I have a window showing the current state of some LEDs. I already have it set up using simple rectangles and a method that either turns the box above the label on or off depending on the state of the LED, but it doesn’t currently show the intensity.

They’re all a fixed height of 40 pixels so I’m just multiplying the intensity (as a percentage) by 40 and arriving at a new height.

image

In this example, R1 is on at 50%. The others are on at 100% The problem is that when I change the height of the rectangle:

wStatusWindow.indicatorR1.Height = newbarheight

It works but is aligned to the top. Is it possible to make a row of rectangles align to the bottom, so that when I change the height it’s the top that moves, not the bottom?

The only way I can think of is to recalculate the top of the rectangle based on the new height, but this is a lot more code and it means if I ever reposition the rectangles within this group box, I’ll have to also modify the code to reflect that new position. I’m hoping there’s a simpler way to do this.

11 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 3762

Trending Articles