LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I control where the front panel opens with reference to screen locations

I am not talking about using a Property Node and changing the origin. I want the Front panel of one VI to appear in the upper right hand corner of the screen and want the other to open and appear at the lower left hand corner of the screen.
Please repond.
Tim Burroughs
email:tburroughs@labratsengineering.com
email:tburroughs@northropgrumman.com
0 Kudos
Message 1 of 3
(3,885 Views)
Here are two ways of doing it.

1. A VI's front panel will be displayed at the screen position at which it was last saved. If you have two different VI's which you always want to display at specific locations, just move the panels where you want them and resave the VI's. The VI's will now always open at their new locations, either in the Labview environment or after you recreate an exe using the application builder. But if you distribute your application to a machine with a different screen resolution, they may not display where you expect: e.g., going to a lower resolution, some of the front panels may be off the screen.

2. If you want to move them programatically, look at using Get Panel Size.vi and Resize Panel.vi in C:\Program Files\National Instruments
\LabVIEW 6.1\vi.lib\Utility\victl.llb. By keeping the difference the same between top and bottom and between right and left, you can use Resize Panel.vi to move the panel, not re-size it.
Message 2 of 3
(3,885 Views)
The property Window Bounds allows you to position a panel in screen coordinates. I call a VI called Get Screen Size (part of the lvwutil32 library) first, then I read the current Window Bounds, recalculate them, and then write the new coordinates to the Window Bounds property. If your VI is always going to be run on screens of the same size and resolution, you can just write some constants to the Windows Bounds property.
Message 3 of 3
(3,885 Views)