LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ON-OFF Toggle button Event left click

Hello Friends,

 

A small problem is troubling me a lot. I am using a Toggle OFF-ON button. I want to program it like if I perform EVENT_LEFT_CLICK, I should get in my variable attribute =1 using command GetCtrlVal (panel, PANEL_TOGGLEBUTTON,&attribute). Similarly when I release the event, i.e. if I perform EVENT_LEFT_CLICK_UP, I should get attribute value =0.

 

But everytime if I perform the first operation EVENT_LEFT_CLICK without leaving the mouse click, I get attribute =0.

 

Can someone help?

 

Best Regards

Raunak

0 Kudos
Message 1 of 2
(3,825 Views)

The toggle button is a two-state control: either is on or off; it is not a control that is on when clicked and off when released. Control operates this way: starting with the button in off position, at some time while clicked it could change its state, but when released it will surely assume status on. That is to say: you can get its value with EVENT_COMMIT, not with mouse click events.



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 2
(3,817 Views)