Change button color and text after it is clicked

16 ビュー (過去 30 日間)
Raldi
Raldi 2012 年 1 月 6 日
回答済み: munib chauhan 2017 年 2 月 23 日
Hi all, i was wondering if there is a way to change the color and text of a button created with "guide". For example if it is clicked it should say running... and not being clicked anymore?

採用された回答

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 6 日
in the pushbutton callback write:
set(handles.pushbutton1,'string','running','enable','off');
  3 件のコメント
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 6 日
Yes, of course
Let the OP develop the way he thought!
Raldi
Raldi 2012 年 1 月 6 日
Thanks for your help everyone.

サインインしてコメントする。

その他の回答 (2 件)

Sagar
Sagar 2013 年 7 月 4 日
But how to change the color of the text that gets printed onto the pushbutton when it is clicked ?
  1 件のコメント
Nikhil Magdum
Nikhil Magdum 2014 年 2 月 28 日
set(handles.pushbutton1,'string','running','ForegroundColor','red','enable','off');

サインインしてコメントする。


munib chauhan
munib chauhan 2017 年 2 月 23 日
you can use this also for text and color change set(handles.togglebutton1,'string','ON','enable','on','BackgroundColor','green');

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by