Preventing the User From Closing a VI During Execution

Updated Nov 20, 2023

I want to prevent users from closing the front panel of my application when it is running. They can currently use the abort button or the close button in the corner of the window.

There are several ways you can prevent users from closing the front panel:
  • Using property nodes:
You can use the following property nodes to prevent users from closing the front panel using the close button or abort button respectively

 
  • Using the VI Properties:
 
  1. Go to File»VI Properties.
  2. Choose the Window Appearance category.
  3. Click Customize.
  4. Uncheck Allow user to close window.
  • Using an Event Structure:


You can use an event structure to capture the Panel Close? filter event, and discard the panel close action by wiring a True constant to the Discard? filter node on the right side of the event structure.


 

Additional Information

Using an event structure, when the user closes the front panel of an application in LabVIEW, an event structure can capture the event with the Panel Close? event and discard the event, allowing the window to remain open. The Panel Close? event is a filter event which notifies you that the user has performed an action before LabVIEW processes it. This allows you to modify the default behavior of the event.