MATLAB: Set GUI button colors in GUIDE

buttonguiguide

How can I modify the property in the property inspector in GUIDE (so I don't have to go through all my code) to modify the toggle button behavoir so it is the default gray when it is up, and green when it is toggled down?

Best Answer

That cannot be done through the property inspector.
In order to change the color of the toggle button, you need to set the CData property to be a truecolor image of whatever shape and color is appropriate for the current state. There is only one CData property, not one for "on" and one for "off", so you need to have code to set() the CData property differently as the state changes.