From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically block window close

Solved!
Go to solution

Is there a way to disable a user's ability to exit the window while the program is running.  For safety, I want to force the user to terminate all of the outputs before quitting the program.

0 Kudos
Message 1 of 8
(2,541 Views)
Solution
Accepted by topic author grabeer

Hello grabeer

Catch "Panel close?" event and discard it if the application is not ready to stop.

Message 2 of 8
(2,538 Views)

You may also want to include Application Instance Close? too.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 8
(2,532 Views)

You can also go to File -> VI Properties -> Customize -> uncheck Window has Title bar.

 

Ben64

Message 4 of 8
(2,527 Views)

@ben64 wrote:

You can also go to File -> VI Properties -> Customize -> uncheck Window has Title bar.

 

Ben64


Can this be set during run-time?  It sounds like the OP wants to enable closing of the close window once the shutdown process has happened.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(2,521 Views)

You're right, it cannot be set during run-time. Usually I do as specify in a previous post: filter the panel close event, make sure everything stop properly and then exit the application. If you don't show the title bar you can provide a stop button that do the same thing (I usually do this for a vi loaded in a subpanel).

 

Ben64

0 Kudos
Message 6 of 8
(2,516 Views)

@ben64 wrote:

You're right, it cannot be set during run-time. Usually I do as specify in a previous post: filter the panel close event, make sure everything stop properly and then exit the application. If you don't show the title bar you can provide a stop button that do the same thing (I usually do this for a vi loaded in a subpanel).

 

Ben64


I generally do it the same way. Only I add the Aplication Instance Close? and a user exit event. I have the panel close and application close fire the exit event which has all the cleanup code. That way I have one means of actually exiting the application and I can be assured that the cleanup code has been executed.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 8
(2,507 Views)

worked perfectly...thanks!

0 Kudos
Message 8 of 8
(2,502 Views)