Centre aligned label text to bounding box

This might be a stupid question.. but I can't work out how to centre-align my labels. I have it working as per the Inductive University video for buttons, but the same HTML code doesn't work for labels.

In my Data.Text field of the label, I'm using:

<HTML><CENTER>Testing...

But all I get is the left aligned text "Testing..."

Is it possible to align label text? What about vertical alignment?

Thanks in advance.

Regards,

Nick

Edit:
The alignment works sort of, but only if I have more than one line of text and it only aligns to the width of the longest line string..
Is there any way to align it to the label bounding box?

Hi Nick,

At the bottom of the properties panel, you’ll find the layout options.

Old post, but adding more information for the next person to Google this.

To do this dynamically in Vision, use a style customizer. Add a custom property to the label, and then use that to drive the property change. You can then bind the custom property to something else in your window.

For example (0=left, 1=center, etc.):


I would pass in a string to make it easier. Otherwise you're having to remember what 0,1,2,3,4 are. Just pass in left, right, center, leading, or trailing or similar. (I actually never bothered to read what trailing and leading did :thinking:)

You then might just be able to bind the string to the alignment property; I can't remember if this is an integer under the hood or a string

For when mixing text and icon.

1 Like