LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Label alignment in LabVIEW

Here is a difficult one I hope, because I couldn't solve it in about 40 min: When changing the fontsize of a label in application font of a LabVIEW indicator, with 'Size to Text' turned on, the anchorpoint of the label defaults to the RIGHT top corner. For unknown reasons, this anchor point for some of my indicators has spontaneously changed to the LEFT top corner. This can spoil the layout of the screen on end-user PCs where the application font is unknown (with the anchor point on the left for instance and a larger application font size as on the developer's PC, the label overlays the indicator itself).
Can you please help with this and tell me how I can influence the position of the anchor point position of labels or captions?
0 Kudos
Message 1 of 4
(3,437 Views)
I have opened your example and changed the font size of label 2, back and forth between 14 and 18. The label expanded to the left and did not overlap with the numerical indicator. When contracting, it contracted from the left. The anchor point stayed at the right as it should. I am using LV7. I can't explain why it would behave differently on your computer. I moved the label to the right of the numeric indicator and the anchor point was set to the left, as it should be. Moved label back to the left and the anchor point was reset to the right. Can't recreate your problem here, sorry.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(3,437 Views)
Many thanks for trying and can't explain the different behaviour on your machine. I'm using 7.0 too and even after a cold start of LabVIEW and loading my own vi from the NI site I get the undesired effect (stretching to the right instead to the left). Is anybody out there able to shed some light on this, it is very annoying. By the way, there is no need for a font size change, adding some characters to the label has the same effect.
0 Kudos
Message 3 of 4
(3,437 Views)
Thanks to tbob's comment I have just found the solution to my own problem: when a label is moved, its anchor point is redetermined: it must work approximately like this: if the right side of the label is left of the centre point of the indicator, the anchor point is set to the right of the label. If the left side of the label is right of the centre point of the indicator, the anchor point is set to the left of the label. Misbehaviour of labels can occur when the number of columns in an array is under programmatic control, using property nodes, and this was causing the problem in my application. Tbob: Thanks for playing around with the position of the labels in my example.
0 Kudos
Message 4 of 4
(3,437 Views)