LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Button enable

Hello,
 
i will enable and dissable a button.
The button ist visible but the color should to grey.
The command is blocking too.
 
Thanks
0 Kudos
Message 1 of 4
(4,257 Views)

Hello,

If I understand your question correctly, you want to know how to disable a button, without making it invisible to the user. To do so, use the SetCtrlAttribute function.

To disable the button: SetCtrlAttribute (panel, button_ctrl, ATTR_ENABLED, 0);

To enable the button: SetCtrlAttribute (panel, button_ctrl, ATTR_ENABLED, 1);

You can use the ATTR_ENABLED attribute for almost any control type.

0 Kudos
Message 2 of 4
(4,253 Views)

ATTR_ENABLED refers to timers only, disabling them and stopping the callback.

You should be using ATTR_DIMMED

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

The simplest way is to use SetInputMode (panel, control, mode);

Setting mode = 0 will disable the button and grey it out (the same as SetCtrlAttribute with attribute ATTR_DIMMED and value 1); setting mode =1 qill enable the button.



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?
0 Kudos
Message 4 of 4
(4,234 Views)