GUI radio button
2 次查看(过去 30 天)
显示 更早的评论
Is it possible to use the radio button to indicate if something is on or off? Right now, whne someone select the radio button it turned green. So for example, I want it to lit green when it's on and red when it's off. How would I go about changing the color of the radio button? How do I get it have to be select all the time. I couldn't find anything in help so I don't know if it's possible. If there is a better way than using radio button, much appreciate. Thanks.
0 个评论
回答(2 个)
Daniel Armyr
2011-2-7
Sure you can. Just set the Value property of the radio button to 0 or 1 depending on what you want. To make sure the user doesn't change the value for you, set the Enable property to 'inactive'. That way, the radio button will look like normal, but clicking it won't make a difference.
Another way (Not tested by me) would be to place a small square panel and then change the collor from say green to red. That should be very clear to the user.
0 个评论
Walter Roberson
2011-2-7
I don't believe you can control the button color independently of the color of the uicontrol (unless perhaps it is possible using Java.) You can set the color of the uicontrol using the Backgroundcolor property.
Note: the uicontrol Foregroundcolor property does not control the button color: it controls the color of any text you associate with the control.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!