LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing front panel

Is it possible to close (or hide) the front panel of a top-level vi without stopping the subvis?  I have a top level program that just brings up a dialog box asking which of two subvis to run.  I would like the front panel of the main vi to disappear when the subvi opens.

If not, the best solution I can think of is to remove all the buttons and menus from the top level program so that the user cannot accidentally close the window and exit the subvi.  This seems to work, but I am left with an empty window, which is kind of funny looking.  Is there a better solution?

Thanks,
Kasey
0 Kudos
Message 1 of 10
(4,043 Views)
Set the front pannel property (programatically using a property node) to hidden or minimized, I think this will do what you want.
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 10
(4,026 Views)
falkpl beat me to it.

Message Edited by jasonhill on 12-14-2005 03:10 PM

0 Kudos
Message 3 of 10
(4,027 Views)
Sure you can reopen it, close it just don't hide the FP without saving a reference to the front panel otherwise you will have trouble showing it again .  I guess if the VI is not a reenterant VI you could just recreate it, also in worst case senerio you could use the USER32.dll calls to find the window by name and reset the state to show window, but this is ugly. 
 
See the attached Vi.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 4 of 10
(4,022 Views)
I tried closing the FP, waiting, then setting it to standard.  I got an error claiming that it could not find the reference.  I think hidding is safer than closing.  You can write the reference to a variable, but you have to rely on noone changing it between closing and reopening the front pannel.
0 Kudos
Message 5 of 10
(4,016 Views)

When I said Close, I was referring to hiding the front panel, If you close a vi you will stop it, hiding the vi will only remove the front panel from the users view and task bar, but will continue to execute as normal. This is nice when you want to temporarily prevent a user from messing with controls (ie during critical moments in a test).  You can also set all controls to disabled "grayed out", (nicer than hiding all controls which can confuse users). 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 10
(4,014 Views)
I actually use greyed out controls a fair amount.  It is handy for keeping the user from jumping the gun during long calculation times.  Never tried to to it with the whole front pannel.
0 Kudos
Message 7 of 10
(4,007 Views)
Sorry for the confusion, There isnt a grey out for the whole panel since it is a property of the gObject>>Control but you can easly gray out all with very little code using the attached vi.  This is a nice method since you will not have to kwwp track of all references to all controls, and adding new controls/removing controls from a front panel will never break the code.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 10
(4,002 Views)
Oops forgot to attach,
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 10
(4,001 Views)
Thank you.  The hide front panel vi showed me exactly what to do.

Kasey

0 Kudos
Message 10 of 10
(3,972 Views)