10-22-2008 08:34 AM
Hi,
I ahve attached an VI In that i made one Sub Vi(POPUP.vi) to pop up in the screen i have one Button(DONE) to close the popup.If i close the Vi by clicking the red X button in the Right Top corner of our window page the sub Vi(POPUP.Vi)is not closing and giving the control to main Vi which is called.My question is can we take the property of the res X close button and make use it to close the Vi.
10-22-2008 08:58 AM - edited 10-22-2008 08:59 AM
In order to close the sub-VI, you must configure it for this behaviour :
open sub-VI >> CTRL+I >> Category = Window Appearance >> Customize... >> Check Show front panel when called and Close afterwards if originally closed
Doing so, the sub-VI will always behave like this by default.
But you can also set its behaviour for one particular node :
open main VI >> right-click on sub-VI >> SubVI Node Setup... >> check option according to the expected behaviour
Feel free to post back if this shouldn't answer your question.
10-22-2008 09:56 AM
10-22-2008 11:45 AM
Unless you trap the X in the Corner, it closes the window and doesn't let your LV code know that it is happening. This is your problem.
To trap the X, use the '<This VI> -- Panel Close?' event. See attached...
Randy
10-22-2008 01:50 PM
You could customize the vi properties, windows appearance to disable allowing the user to close the window. This will grey out the x.
Hope this helps
10-23-2008 12:09 AM