LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

centering GUI in LabVIEW

Solved!
Go to solution

Hi

 

I have been developing some control software with a GUI. I have sized the gui to fit on a 1280 x 1024 monitor (this is the smallest monitor which will be used). I have given the GUI a black background. When a large monitor is used, I would like the gui to be maximised (so the black background covers the windows OS behind it. I would also like the 1280 x 1024 box to appear centred. 

 

Using the vi properties, I have been able to get a centered gui or a maximised gui. Is there any way to centre the gui on the maximised black background?

 

I have just begun to experiment with reading the current monitor resolution. I'm thinking that horizontal resolution - 1280 (width of my window) / 2 will equal the left position of the window and the same for the vertical position. Is there any mileage in this? 

 

many thanks

 

John 

Message Edited by eichlerjw on 09-03-2009 10:17 AM
0 Kudos
Message 1 of 18
(6,229 Views)

to better illustrate my problem, I have attached a couple of vi's. Check.vi returns the current monitor resolution and runs the other vi at that size. However, the contents of run.vi are not centred. How can I do this?

 

Thanks. John 

Message Edited by eichlerjw on 09-03-2009 10:47 AM
Message Edited by eichlerjw on 09-03-2009 10:48 AM
0 Kudos
Message 2 of 18
(6,211 Views)
What is your lv version? Will this help?
0 Kudos
Message 3 of 18
(6,191 Views)

Inside the Window Size category, there will be three checkboxes, two of which are named Maintain proportions of window for different monitor resolutions and Scale all objects on front panel as the window resizes.

 

Did you try this?

0 Kudos
Message 4 of 18
(6,185 Views)

I would use the "Maintain proportions of window for different monitor resolutions" and "Scale all objects on front panel as the window resizes" with caution.  If your front panel is 1280x1024, because there are enough controls and indicators to fill the space than these options aren't really for you.  These two options are, however, ideal if you break your front panel into a handful of individual windows.  For instance, I try to have my "graphing" in its own window, and these two options give my users a lot of flexibility at run-time.

 

Now, if you use these two options on an array of clusters you are going to most likely run into problems when the user resizes the window.

Message 5 of 18
(6,180 Views)

 


Now, if you use these two options on an array of clusters you are going to most likely run into problems when the user resizes the window.

 

 

Thanks for adding and yup thats true!!!!

0 Kudos
Message 6 of 18
(6,175 Views)

Thanks for the replies. I don't want to scale the contents of my 1280x1024 window. I want it to remain the same size. The problem is that the vi's are developed on a computer with a widescreen, high resolution monitor.  The vi's are then deployed to various machines, which have a minimum resolution of 1280x1024.

 

So, on my gui, I create a frame (decoration) which is 1280x1024 and contains all my front panel controls and indicators. I would like to be able to center this frame on the screen at runtime and (at the same time) run it in maximised mode (so that the blank background of the gui covers the windows OS if it is running on a high resolution monitor). Is this only possible if I scale up the 1280 window when it is used on higher resolution monitors?

 

 thanks again

 

John 

0 Kudos
Message 7 of 18
(6,150 Views)

Hi John,

 

you should get the point from this:

PaneOrigin.png

 

You have to set the origin of the pane according to screen size... (For easy creation I just took the first pane, set origin property to write.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 18
(6,142 Views)

nice one!

 

I'll have a play with that later

 

cheers

 

John 

0 Kudos
Message 9 of 18
(6,141 Views)

I have a solution but it isn't very ideal...

 

Use remote panels, place the LabVIEW front panel object inside a <div> and center the <div> on the page using CSS.  The web browser is can probably be set to "full screen" as well.

 

I sitll haven't come up with a good way to center things like you ask in LabVIEW.  Full screen seems to be non-existent.  The best I could come up with is to hide the taskbar in Windows.  I tried making the window slightly taller than my screen vertical height, and then hide the window title above the viewable area but something kept knocking it back down.  I think Windows won't let you do this.

0 Kudos
Message 10 of 18
(6,139 Views)