LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessSystemEvents for only ONE Command Button

Solved!
Go to solution

Hello

I am implementing a program that starts a long series of measurements when the Start button is pushed. I would like to add a Stop button in order to let the user abort the measurement process. First, I added a ProcessSystemEvents() in the measuring loop. The problem is that not only the Stop button activates itself but the other (setup, read etc) command buttons too. I would like to deactivate all the buttons except the Stop button. Is there a function like ProcessSystemEvents() but only for ONE command button?

Thanks

0 Kudos
Message 1 of 4
(3,522 Views)
Solution
Accepted by topic author missmarie

Hi,

 

I did not understand what you meant by 'the button actives itself' but you can use the function SetCtrlAttribute (panel_handle, control_id, ATTR_DIMMED, ..) to allow or disallow user input.

0 Kudos
Message 2 of 4
(3,520 Views)

Exactly what I was looking for! Thanks!Smiley Very Happy

0 Kudos
Message 3 of 4
(3,507 Views)

Another option is to use GetUserEvent(...) instead of ProcessSystemEvents(), which will provide you with what panel and control the user clicked on.  You could then react appropriately if the user pushed the 'Stop' button and ignore all other controls.

0 Kudos
Message 4 of 4
(3,498 Views)