GUI radio button
6 ビュー (過去 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!