残心 发表于 2006-9-6 20:04:46

事件结构中带问号和不带问号有什么区别??

LabView中事件的触发中后面有带问号和不带问号的,请问他们有什么区别啊?? 如事件中有Mouse down和Mouse down?

szb 发表于 2006-9-7 04:15:26

<p>以下为LV帮助文件的解释:</p><h1>Prompting Users with Dialog Boxes in a Mouse Down? Event Case </h1><p class="Body">Event cases that prompt users with a dialog box can cause unexpected behavior in the VI. For example, if you use a Mouse Down? event with a numeric control and configure the event case to prompt you with a dialog box, the Event structure responds when you click the numeric control, including the increment or decrement arrows, and displays a dialog box. Because the dialog box appears while you still have the mouse button depressed, the dialog box retains focus when you release the mouse button, and the numeric control never receives notification of the change in the state of the mouse button because the dialog box receives the notification instead. After you close the dialog box, the numeric control resumes responding to the previous Mouse Down? event and can continue to increment or decrement the control indefinitely, even though you are no longer pressing the mouse button. </p><p class="Body">To avoid this problem, National Instruments recommends that you do not use dialog boxes inside event cases that handle the Mouse Down? event. Instead, invoke the dialog box inside the Mouse Up event case or outside the Event structure. </p>

wdyjz 发表于 2006-9-7 19:29:08

<p><u>注意:</u></p><p><u><font color="#494949">1. 如果你的VI没有用Panel Close?事件而是Panel Close事件而且你的VI没有被其他VI调用,当你关闭窗口的时候,该VI被强行中断,在“Panel Close“ case里的程序并未执行。 如果你的VI被其他正在运行的VI调用,一切正常。 你的VI只是关闭了前面板并不一定停止运行。 一般来讲,我推荐用Panel Close?事件。</font></u></p><p><font color="#494949"></font>&nbsp;</p><p><u><font color="#494949">2. Panel Close事件并不常用来做VI本身的后处理。但是有个用途很有用:一个VI(A)检测另一个VI(B)是否还在运行。做法是在A中用B的reference动态注册B的Panel Close事件。当B退出是A可以知道。</font></u></p><p><u><font color="#494949"></font></u>&nbsp;</p><p><u><font color="#494949">3. 如果你用Front Panel:Open属性或Front Panel:Close方法关闭一个VI. 该VI不会得到Panel Close事件。</font></u></p><p><a href="http://e.simwe.com/html/v/o/b/viewspace_1954.html">http://e.simwe.com/html/v/o/b/viewspace_1954.html</a></p>
页: [1]
查看完整版本: 事件结构中带问号和不带问号有什么区别??