LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Save & reload front panel position

I would like to save the front panel position into an ini file or registry, so that the next time the program is used, it comes up where the user left it.
 
With the Invode Method: Front Panel.Run-Time postition.Get positon  
I can get all the position data I want:
  • left-top
  • state
  • monitor
 
 
However...  How do I set the same information at startup?   
There's no  Front Panel.Run-Time Position.Set position. as far as I can see...
 
To set position, state and monitor values, it seems I need to first call  FP.Open for the state, then FP.Run-Time Position.Centered to select the monitor, and then FP.Run-Time Position.Custom to set the position....   
 
That looks weird and complicated...    Am I missing something here?   Is there a more elegant approach?
0 Kudos
Message 1 of 5
(5,029 Views)

Using Property nodes instead of Invoke nodes, you can set the Top, Left position of the window.

Ed

Message Edited by Ed Dickens on 11-02-2007 08:05 AM



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 5
(5,013 Views)
Ok...  so I should forget about the methods, and should use a combination of the VI property node and Panel property node to do this. 
 
So what's the difference in using property node versus using the methods?  For example, with the FP.Open property node, the Context Help recommends to use the corresponding method...    Why? Is there a difference? 
 
I don't understand the logic behind it... Why isn't there a Set Position method that's just the writable version of the Get Position method? And if I can do it with the property nodes just as well (better in this case)... do I need the methods at all?
 
 
edit:  Panel Top-Left values don't seem to give what I want...   Those relate to objects on the front panel.   I want the whole program window to move on the desktop...
 

Message Edited by Anthony de Vries on 11-02-2007 04:21 PM

0 Kudos
Message 3 of 5
(5,002 Views)
OK..  Should use VI property FP.Winbounds, and then it works.  So I can get everything with one property node.   Now the question just remains what's the deal with the VI methods.   Are they preferred for some situation? 
0 Kudos
Message 4 of 5
(4,981 Views)
NI explains the difference between Property nodes and Invoke nodes as this.
 
Property nodes access the properties of an object and allow you to read/write those properties.
 
Invoke nodes perform actions on an application or VI allowing you to get and sometimes set attributes of those actions.
 
Sometimes there is some overlap between Properties and Methods as you noticed with the "Get Position" method and the "Panel.Position" property. But most of the Methods do not have a similar Property. For instance, there is a Method you can use on a front panel item called "Get Image". This will return image data about the item that will let you save the items current visual appearance to a graphics file. (.bmp, .png, .jpg) There is no equivalent property to do this.
 
So it really depends on what you are trying to do as to which one you end up using.
 
Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(4,968 Views)