Use the Events tab in the Target Properties dialog box to define the callback VI that is called every time a user removes your target from the Project Explorer window or closes a project.
Navigate to or enter the relative path to the subpanel VI in the Path to OnRelease Plug-In VI text box. If you do not have an existing subpanel VI, click the Create New Subpanel VI button to open the Create New Subpanel VI dialog box.