LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I position a window dynamically?

Solved!
Go to solution

I want my customized "Get Serial Number" vi to be in one of two positions on the screen.  How can I get the system screen metrics so I can determine the (top,left) coordinates of the vi window, and set the position of the window within the vi?

 

Thanks,

Mike

0 Kudos
Message 1 of 4
(2,643 Views)

If you are using a PC, the screen size can be found using the .NET Property Node under Systems.Windows.Forms.SystemInformation.PrimaryMonitorSize

 

You can move the vi front panel using a property node with a reference to 'This VI'.  I have enclosed a not-too-elegant yet functional example.  Hope this helps.

 

-Darin

Message Edited by Darin.K on 07-16-2009 06:55 PM
0 Kudos
Message 2 of 4
(2,638 Views)
Solution
Accepted by topic author mike_22

For those of you not tethered to PCs, a more platform-independent method for the screen size would be the Display WkSpace property, just pass an application reference to the property node and select DisplayWkSpace property.

 

-Darin

0 Kudos
Message 3 of 4
(2,629 Views)
Thanks to both of you.
0 Kudos
Message 4 of 4
(2,602 Views)