LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform some operations after pressing the X button

Hi. This is a basic question about building a "pro" application.
 
Let's suppose I have an application (VI or built executable), which is commonly structured as a while loop.
When the user wants to exit, I need the application to perform some operations (file writing and closing, for example) and then exit. I can easily put a "close" control on the front panel and that would do it, but now I would like to do it with the X button of the title bar, as most "pro" applications do.
As you may know, the problem is that when you press the X button the aplication exits inmediatly aborting the execution, whithout performing the desired operations.
 
Any comments appreciated. Thank you.
 
Daniel R.
0 Kudos
Message 1 of 3
(2,623 Views)
You can use an event structure with a filtering event for "panel close?" In that event case, you could do whatever you want (e.g. create a popup) and then you can either process or discard the panel close operation depending on your needs. Try it!
Message 2 of 3
(2,620 Views)

Perfect. That did it.

Thank you!

 

Daniel R.

0 Kudos
Message 3 of 3
(2,602 Views)