LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Toggle button initially dimmed

Solved!
Go to solution

Hello,

I have a question on how to do it. Initially my toggle button is dimmed and when I received a signal from PLC my toggle button must be active or undimmed.

 

Thanks in advanced.

0 Kudos
Message 1 of 6
(3,470 Views)

Use SetInputMode to dim or undim a control



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 2 of 6
(3,441 Views)

or, in the UI editor, change the setting of the checkbox ;Initially dimmed'

 

button.png

0 Kudos
Message 3 of 6
(3,426 Views)

Hello,

 

Actually I set-up the button like that what I want to know is If I received a input signal from PLC the button should be dimmed or unclickable.

 

int CVICALLBACK Standard (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
{
 switch (event)
 {
  case EVENT_COMMIT:


   GetBitFestoInputs /* if I received signal from PLC (true) the button below would dimmed*/
   /* Dim the STD button and activate the PREM button */
   SetCtrlAttribute (panelHandle, PANEL_STD, ATTR_DIMMED, 1);
   SetCtrlAttribute (panelHandle, PANEL_PREM, ATTR_DIMMED, 0);
   break;
 }
 return 0;
}

0 Kudos
Message 4 of 6
(3,357 Views)
Solution
Accepted by topic author Master_Viper

Yes, that should work. Do you have any problem with that? 



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 5 of 6
(3,348 Views)

Thanks it works.

0 Kudos
Message 6 of 6
(3,341 Views)