LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

centering GUI in LabVIEW

I have a rather large GUI that runs during a test and I cannot figure out why it will not run centered on the monitor screen. I have gone into the vi properties and in the "Window Run-Time Position" tab, I have the Position set to maximized (I would like it to run maximized to show all the features of the GUI) and the monitor set to Primary. 

 

In the "Window size" tab, I have the "Maintain proportions of the window for different monitor resolution" box checked and I am not sure if this is contributing to the problem or not. I am trying to configure this GUI on a pc with one monitor resolution and when it is being run for real, it will be run on a monitor with a smaller resolution. 

 

What happens is sometimes it runs maximized and centered like I want, and other times it will run NOT Maximized but still takes up the entire screen, and it is off center. You can find the screenshots in the zip file attached. 

 

Is there a simple setting for this GUI to run maximized at all times or are the possibly multiple settings that are conflicting with each other to cause this problem? I have done a little digging on the web but I haven't found a solution thus far. 

 

I am using LabVIEW 2014.

 

Thanks!

0 Kudos
Message 1 of 3
(2,822 Views)

Is it running as an executable or a VI? If it's a VI, are you sure you aren't leaving it in that off-centered state? I made a VI "reset front panel origin" and for some user interface VIs I will run this VI first to make sure that the origin is back at the top left. (If your UI is shifted from that, you may have to select all and move everything). You can try it out and see how it works for you.

 

 

0 Kudos
Message 2 of 3
(2,812 Views)

There is a Toolkit available on the LabVIEW Tools Network called the OpenG Toolkit.  It has been around for at least a decade, and I think is fairly widely used.  When I have a GUI I want to exactly fill a Front Panel Window, I create a Decoration that surrounds it and defines its boundaries, then use the Fit VI Window to Largest Decoration.  That gets the Window properly sized and centered where I want it.  I can then use the VI Property to center the Window.  There are two "centerings" -- FP in the VI Window, and VI Window in the Monitor Window.

 

Bob Schor

0 Kudos
Message 3 of 3
(2,788 Views)