LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Closing windows...

I want the user of my application to be able to exit using the cross in the
top right-hand corner (windows). However i want to check the save state of
my application and inform the user if there project is not saved. Currently
i do this by checking the "Open" state of the window and asking the user if
i detect it has been closed. I then re-open the window if they are want to
save it. This works but doesn't look proffesional, does anybody know of an
equavelent method that doesn't close, or flash the main window??
0 Kudos
Message 1 of 4
(2,961 Views)
If you have LV 6.1 or newer you can use an event structure to catch and discard the close, closing the VI in a controlled fashion using your own code (with the save dialog etc.).

Create an event structure, add an event case for the VI Panel close? event, wire a true to the discard terminal and do whatever you want to do inside that case, or set a flag there that you act on somehwere else...

If you have LV5 I may be able to find a VI for you that will do the trick though.
0 Kudos
Message 2 of 4
(2,961 Views)
What version of LabVIEW are you using? With LabVIEW 6.1, the event structure was added that makes it simple. There's a shipping example called Event Conditional Stop that illustrates how to do it.
0 Kudos
Message 3 of 4
(2,961 Views)
I have 7.0 and can see how to do it using the event structure, thanks.

But this code is a legacy 6.0.2 code, just wandering if it was possible.
0 Kudos
Message 4 of 4
(2,961 Views)