关于LabWindows/CVI设计的一些知识点

++++++++++++++++++++++++++++++++++++++++

NO.01- How Do I Quit the CVI Panel by Clicking on the " X " Button in the Title Bar?

++++++++++++++++++++++++++++++++++++++++

Problem: Why does the " X " in the CVI panel not work? How do I quit the CVI panel by clicking on the " X " button in the title bar?

Solution: The X on the CVI panel generates a CVI EVENT_CLOSE function ...

There are two ways that you can handle this :

  1. You can place an ordinary quit callback in your code that causes your application to quit . When editing your *.uir file, double click on the panel to bring up its property page. On the left-hand side you will see a drop-down list labeled "Close Control." Click on this list to select your desired quit callback. By default, the close control does not call anything. By making this change, you direct it to a particular callback function to quit your application. *Note* if you are creating a new CVI panel, and use the tool Code»Generate»All Code to choose one callback to be your quit callback, CVI will automatically map that callback to the Close Control of the panel as well.
  2. The second approach is to have a PANEL callback. In the callback, you should check for the EVENT_CLOSE event. If an EVENT_CLOSE is detected, call the code that will quit your program (typically you will use the QuitUserInterface() function).

你可能感兴趣的:(关于LabWindows/CVI设计的一些知识点)