LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying controls format

Imagine I have some controls on the panel in such a way (see figure).

I would like to be able to copy the entire format (colors, font sizes, alignment, etc...) from control A to the other controls.

Is the a way to do it witha single command either programmatically and in edit mode ?

Thanks you.

 

A.JPG





Message 1 of 8
(4,585 Views)

Try saving the control as a Type def. To do this, right click on the control and select Advanced -> Customize. In the pop out window, change the drop down menu with Control selected to Type def, then save the type def.

 

Think this should work..

0 Kudos
Message 2 of 8
(4,573 Views)

A typedef if a set of default properties for a control. So it will not affect other controls. It only effects controls in two ways:

  • If you create a new control deriving from the typedef, the new control will have the default properties the typedef has. If the typedef is a "weak" one, you can alter any property of the new control after creation except the data type.
  • If you created a Strict Typedef, you cannot alter properties of the new control except label name and value. If you keep the "autoupdate" selected, changes to the typedef will effect existing controls derived from the typedef.

If you want to have existing controls to get the layout of the typedef, you have to replace each control with a control derived from the typedef.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 8
(4,570 Views)

Ok, I understand that if I create a strict typedef, and then many controls o that type, each change to the typedef itself will be reflected on all the controls.

 

But imagine for some reasons I do not want to create a typedef for each of them, I just would like them to look them same.

 

I was thinking to something like the Microsoft Word feature that you select some text, then you hit the button "Copy format", then you select some other text, and the two selections look the same (fonts, colors, size, ecc).





Message 4 of 8
(4,549 Views)

You can modify the default font settings in LV. To do this, you have to open the LV Options => Environment.

 

This affects the fonts for future controls you create. It does not affect size settings like width or height.

If you want to modify this for several controls at once, create them, select them and then use the "Resize Objects" button in the icon bar:

 Resize Objects.png

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 8
(4,545 Views)

I don't think he wants to change the defaults on a global scale.  I think all you have to do is customize a control and save it for use later?  Hopefully you aren't so far along that it's going to be difficult to find all the places where you want to replace the old control with the new one?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(4,522 Views)

I think the analogy of MS Office's "Format Painter" is a good one.

 

For optimal efficiency, modern software should not make developers specify every property of everything individually, but to be able to inherit* properties from somewhere.

 

I sure wish LabVIEW had a feature like this.

 

* or, using similar/equivalent terms: adopt, retrieve, obtain, get.

 

0 Kudos
Message 7 of 8
(4,470 Views)

MattI wrote:

I sure wish LabVIEW had a feature like this. 


There are plenty of similar ideas in the ideas exchange (for example this one). All you need is vote for it. 😄

 

(in the above example, I would simply delete all other controls and do a ctrl-drag to make copies of "A", then change the labels. ;))

 

 

Message 8 of 8
(4,462 Views)