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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by