03-03-2022 05:09 AM
Hi,
I have written a little tool that converts all front panel items to the default style. If I want to change the style of a VI I have to go to the editor options and select the control style before running my tool.
I would like to select the new style in my utility, but I cannot find anything looking through the properties or methods for a VI reference. Does anyone know where to find this property?
Best regards,
Christian.
03-03-2022 07:38 AM - edited 03-03-2022 07:40 AM
@Pumuckl wrote:I have written a little tool that converts all front panel items to the default style. If I want to change the style of a VI I have to go to the editor options and select the control style before running my tool.
I would like to select the new style in my utility, but I cannot find anything looking through the properties or methods for a VI reference. Does anyone know where to find this property?
It's not a property.
Controls of different styles are different controls.
I'm afraid you'd have to get all relevant properties, replace the control, then set all properties. Note that not all properties are valid for all control styles (e.g. the color of system controls can't be changed).
You might be able to (hold on..) set VI storage to XML or text, get a VI as a binary (e.g. the file), get the front panel heap, (inflate it?,) modify the string, (deflate it?,) reset the password hashes, convert back to a VI... Something similar is done with the splitter style tool that is somewhere on this forum. EDIT: Here: Solved: Re: Access Splitter Bar Style Programmatically - NI Community
03-03-2022 07:48 AM
wiebe@CARYA wrote:
I'm afraid you'd have to get all relevant properties, replace the control, then set all properties. Note that not all properties are valid for all control styles (e.g. the color of system controls can't be changed).
It seems that you don't have to get\set the properties.
This works pretty well:
You'd have to find a way to get the control type, and link it to the (new) Style enum value.
LabVIEW keeps properties, just like a manual replace.
03-03-2022 08:00 AM
...I might not have been clear enough on this, i do not have problems with replacing the controls, I want to set the panel default style prior to the replacement.
I found all the other properties for stuff like default fonts, colors, grids etc, but nothing for the style?
03-03-2022 08:33 AM
I don't think there's a property for that.
It could be a hidden VI tag, or a panel tag. It would take serious digging to find where this setting is stored, and even more to change it.
If you start from a new VI, I guess you could store a template for each style.
03-03-2022 09:48 AM
isn't most of that stuff in the INI file?
03-03-2022 09:58 AM
@Frozen wrote:
isn't most of that stuff in the INI file?
This is different for each VI.
The ini file has an option to set the default for new VIs.
03-03-2022 10:29 AM
wiebe@CARYA wrote:
@Frozen wrote:
isn't most of that stuff in the INI file?
This is different for each VI.
The ini file has an option to set the default for new VIs.
Oops, should of looked closer before opening my mouth 😴
03-04-2022 03:19 AM
@Frozen wrote:
wiebe@CARYA wrote:
@Frozen wrote:
isn't most of that stuff in the INI file?
This is different for each VI.
The ini file has an option to set the default for new VIs.
Oops, should of looked closer before opening my mouth 😴
Don't worry about that.
It might be an opening towards a solution.
If you set the (global) ini file key, and then script a new VI, would the new VI have the new style?
get the key
change the key
create a new vi
reset the key
Not ideal, but if it works it's something.
03-04-2022 03:52 PM
Maybe something like this would help you.