LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Press QUIT and not "close window"

Hi There,

I have a vi with some sub-vi. In the vi, I have a case structure in which I can choose to close the program. I want the user to quit the program with this command because if he leaves with a click une the upper right corner (X), that will not close the acquisition boards in my computer and it's very important to close them. How can I make the user close the program only with the 'quit' option?
Is it possible to execute de 'quit' case with a click in the upper righe corner (X)?

Thanks
0 Kudos
Message 1 of 3
(2,684 Views)
Right click the vi's connector icon and pick vi properties under the category pick Window appearance and then click the customize button and uncheck the "Allow user to close window" this will disable the X button....

Dan
0 Kudos
Message 2 of 3
(2,684 Views)
Hi Poly Meca,

Yes this can be done by using an event structure. Catch the event "Panel Close" and perform your regular exit routines. An example called "Event Conditional Stop.vi" can be found under NI Example Finder (under user interface/acquiring user input/general).

Also it's possible to disable the "X" panel closing icon. Go under VI properties/windows appearance/customize, and uncheck "Allow user to close window".

Hope this helps,
Dan
Message 3 of 3
(2,684 Views)