From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sizing a front panel based on the screen resolution

I remember a long time ago reading somewhere (too bad I can't remember
where) that you can read the screen resolution that Windows is set to. I
have a front panel that I want to dynamically size and position based on the
screen resolution of the user's screen. I know how to move and resize the
panel, but I can't remember how to determine the bottom, and right pixel
locations of the screen.

Any help would be greatly appreciated.

Thanks,
David Dupont
0 Kudos
Message 1 of 8
(4,201 Views)
The one I use is from the Windows Utilities for LabVIEW. It can be found at http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&74DDE683A1AFF6988625683A000C0D73&cat=E2A99E7E10D5725D862567AC004F0A53.
Message 2 of 8
(4,199 Views)
If you place a property node with its VI Server Class set to Application and select the Display>>Primary Workspace property you will get a cluster containing 4 values (left,top,right, and bottom). I think that these are what you are looking for.

See attached vi

Brian
Message 3 of 8
(4,200 Views)
Hi Mr Brian,
I have seen your reply for a doubt regarding the window size adjustment of a vi with different monitor resolution.I will appreciate you if you can clear my doubt.I have made a vi in one computer and got to run in another computer but the resolution there is different .As i want to adjust the window size i am working on that .I have your vi screensize.vi with me .
You have described about a procedure with propert node.But i didn't get you.
It will be gretaful if you can clear my doubt.
thanks in advance.
regards
Prasad
0 Kudos
Message 4 of 8
(4,199 Views)
Hello, I was using your vi, screensize.vi. The problem is that the value "bottom" is not the real resolution of the screen (normally 768 pixel), but it returns the value where the tasklist begins. Do you know how to solve the problem.

Thanks
Lukas
0 Kudos
Message 5 of 8
(4,112 Views)
The property is Display: Primary Workspace so the number returned is valid when the task bar is visible and only the size returned is available. If you just want the absolute values, use the property Display:All Monitors. This will return an cluster array. One of the clusters is called bounds which has the data you want.

Message Edited by Dennis Knutson on 04-27-2005 09:04 AM

Message 6 of 8
(4,102 Views)
Prasad:

If you create an Property Node from All Functions>>Application Control, and set it to the Display:Primary Workspace property, you will see your monitor resolution. In this way you can use this property ndoe to display the resolution of any monitor you want to run your VI on, and change the VI size according to the monitor resolution.

I order to set the size of a VI you would need to use the Open VI Reference VI and wire it to a Property node (both found on the All Functions>>Application Control palette). Set the Property Node to Front Panel Window>>Panel Bounds. You can read and write to this property and hence set the size.

Thank you

Nandini Subramaniam
Applications Engineering
National Instruments
Message 7 of 8
(4,067 Views)
Hi!
Follow the steps.
File>VI Properties>Windows size.

Set the following properties -
1. size the front panel to the width and height of entire screen.
2. Maintain proportion of window for different monitor windows.

See the attachment.

Kaustubh
VC (Pune)
INDIA
Message 8 of 8
(4,043 Views)