03-04-2009 12:08 PM
How can I change a command button color when it is pressed and held?
i.e. I want it to turn green momentarily while being pressed.
Thanks.
Solved! Go to Solution.
03-04-2009 12:59 PM
In my opinion the best option you have is to use a toggle button, painted in the desired colours in the two available states. In the callback of the button set its value to 0 immediately before exiting:
SetCtrlVal (panel, control, 0);
03-04-2009 02:23 PM
03-05-2009 04:40 AM
03-05-2009 04:26 PM
The visual state of the controls is not updated while inside the callback: that is why you don't see the control in ON state. Insert a ProcessDrawEvent ( ) as the very first instruction in your EVENT_COMMIT callback, next proceed with the rest of the code. You will see at lease a flash of the ON color.
Tell us if the ON state time is too short so that we can suggest some additional hint.
03-05-2009 05:16 PM
The EVENT_LEFT_CLICK_UP achieved the desired effect. The toggle button now displays the 'On' colour until the button is released.
Thanks all.