LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem resizing front panel text with object

I have a front panel that has been setup to change size based on the screen resolution. The objects on the screen resize but the text in the objects do not resize. this throws the whole look of the front panel out of whack! is there a way to resolve this problem?
0 Kudos
Message 1 of 7
(4,027 Views)
Or you can set the screen resolution programmatically to fit your front panel size.
Many game does this.

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 2 of 7
(4,013 Views)
You can find some more suggestions here:
http://forums.ni.com/ni/board/message?board.id=170&message.id=26026&requireLogin=False

Good luck with your application!
Shakhina P.
NI
0 Kudos
Message 3 of 7
(3,994 Views)
As you said, LabVIEW does not resize fonts when it resizes objects when resizing the front panel (sometimes your really don't want to - I've been on both sides of this argument). However, you can resize fonts programatically using the FontSize property of the text in question. If your version of LabVIEW is new enough, use the Panel Resize event on the VI to determine when you need to resize the fonts. If you don't have a new enough LabVIEW version, poll every 100ms or so to determine if your panel size has changed.
Message 4 of 7
(3,984 Views)
I have the same problem, but too many text to be resized... is there any way of changing all text in the front pannel according to screen resolution??
Thanks in advance
0 Kudos
Message 5 of 7
(3,963 Views)
Hi Esther,

If it is Ok for all the fonts in your VI to be the same, you can change it in Tools -> Options -> Fonts -> Font Style. You would need to relaunch LabVIEW to see the effects.

Also you can change all the label and caption fonts using VI Server. You would open a reference to your VI using a VI server, get the Front Panel then Controls[] properties and change Label/Caption -> Font -> Size property in a loop.

Hope this helps a little.
Good luck!
Shakhina P.
NI
0 Kudos
Message 6 of 7
(3,938 Views)
There is no way to change all the fonts at once, but you can automate it quite a bit with the VI server. Each control type has a different set of text strings to change, so get the references of all the objects on the front panel and process them by class name. You only need to write cases for the controls you use. The attached graphic should get you on your way. If you have never used VI server before, all the primitives are available in the Application Control palette. Note that you will need to “recursively” search through clusters, since only the top element will be returned in the initial array of objects. The graphic shows how to do this. Other containers will need to be handled similarly. Things such as digital controls just need the fonts changed.
0 Kudos
Message 7 of 7
(3,932 Views)