LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically move label to default label position

Hi,

 

In my program, I have to constantly change the font size of my label. Before doing that, I want to make sure that the label is in the default label Classic position as specified in the options.

jamisonsuade_1-1718712746379.png

 

 

jamisonsuade_0-1718712357408.png

 

I can do the Quick-Drop Ctrl-T shortcut during edit time. But what I am looking is to replicate or do this behavior programmatically during run-time. 

 

As a start, I checked in the resource\dialog\QuickDrop\plugins, the quick drop code Move Labels.vi. I haven't checked the code thoroughly but it seems complicated. Maybe someone already implemented a much simpler implementation to this problem.

0 Kudos
Message 1 of 2
(169 Views)

It's just math and coordinate properties.

 

You can get a part of the code from the Move Labels.vi, it's not too bad. It might do more than you need though, it also moves captions, and considers cluster auto grow, etc.

 

Align Label.png

 

The only trick it uses is to use the (scripting) property "Master Bounds Rect". This rectangle doesn't include the "increment\decrement". If you do want to include them, simply use the control's position property.

0 Kudos
Message 2 of 2
(117 Views)