LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetCtrlAttribute only works during debug!

Hi Folks,

Having a bit of bother with SetCtrlAttribute for a text box & some
buttons on my UIR. Basically, during execution of a do while loop, I
have a couple of SetCtrlAttribute lines which set these controls to be
dimmed (as they are inoperable during this loop). Strangely, they do
not dim - unless I interrupt the program (Ctrl + F12) - whereupon they
dim immediately.

I am using SetCtrlAttribute in other lines in the same section of
code, in exactly the same way, to change the colour of LED controls.
These function correctly!

Any thoughts ?

BTW running CVI 4.01 on NT4.0


TIA

Craig Jackson
0 Kudos
Message 1 of 3
(2,935 Views)
Updating of the user interface is not executed during while loops unless you put inside the loop a ProcessDrawEvents () statement.
For the same reason, detecting user interface events (button clicks and so on) is not possible unless you put inside the loop a ProcessSystemEvents () statement. This statement updates also the user interface (so the use of ProcessDrawEvents is not needed).
Look in the functions help for more detailed reference about them.

Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(2,935 Views)
Roberto Bozzolo wrote in message news:<5065000000050000002D900000-1027480788000@exchange.ni.com>...
> Updating of the user interface is not executed during while loops
> unless you put inside the loop a ProcessDrawEvents () statement.
> For the same reason, detecting user interface events (button clicks
> and so on) is not possible unless you put inside the loop a
> ProcessSystemEvents () statement. This statement updates also the user
> interface (so the use of ProcessDrawEvents is not needed).
> Look in the functions help for more detailed reference about them.
>
> Hope this helps
> Roberto


Thanks alot Roberto, this has done the trick.

Craig Jackson
0 Kudos
Message 3 of 3
(2,935 Views)