04-13-2016 06:46 AM
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
04-13-2016 10:49 AM
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.