LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows: Any easy way to disable (gray-out) all controls in a panel?

I have a UI panel which contains numerous text boxes for displaying settings values, each of which can be changed by the user, depending the user privilidges.
Is there a quick way in the C code to lock up all text boxes, ie. display current values but not allowing editing? Otherwise I'd have to set attributes for each control individually, which is tedious.
 
Please advise! Thanks!
0 Kudos
Message 1 of 5
(4,891 Views)
Well, after searching through the library, I found a function named SetInputMode(panel, controlID, enable). If you set controlID=-1, it will set ALL controls on the panel as "read-only", ie. gray out.  This is good enough for me for now.
0 Kudos
Message 2 of 5
(4,863 Views)

You can dim the whole panel with the ATTR_DIMMED panel attribute. This dims the panel and all the controls on the panel.

SetPanelAttribute(panelHandle, ATTR_DIMMED, 1);

0 Kudos
Message 3 of 5
(4,852 Views)
Hi Shef,

There is a knowledge base that shows how to do this here:
Enabling and Disabling Input to Controls on the User Interface in LabWindows/CVI

Regards,
0 Kudos
Message 4 of 5
(4,841 Views)
Thank you Jared and James for your info!  I appreciate it very much.
I've just tested Jared method using ATTR_DIMM. It seem to do the same thing as SetUserInput with -1, but more intuitive & understandable.
It's also good to know the existence of KnowledgeBase. As you can see, I'm a newcomer here.
NI has done a great job to set up this website.
0 Kudos
Message 5 of 5
(4,835 Views)