Change button color and text after it is clicked

16 vues (au cours des 30 derniers jours)
Raldi
Raldi le 6 Jan 2012
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?

Réponse acceptée

Chandra Kurniawan
Chandra Kurniawan le 6 Jan 2012
in the pushbutton callback write:
set(handles.pushbutton1,'string','running','enable','off');
  3 commentaires
Chandra Kurniawan
Chandra Kurniawan le 6 Jan 2012
Yes, of course
Let the OP develop the way he thought!
Raldi
Raldi le 6 Jan 2012
Thanks for your help everyone.

Connectez-vous pour commenter.

Plus de réponses (2)

Sagar
Sagar le 4 Juil 2013
But how to change the color of the text that gets printed onto the pushbutton when it is clicked ?
  1 commentaire
Nikhil Magdum
Nikhil Magdum le 28 Fév 2014
set(handles.pushbutton1,'string','running','ForegroundColor','red','enable','off');

Connectez-vous pour commenter.


munib chauhan
munib chauhan le 23 Fév 2017
you can use this also for text and color change set(handles.togglebutton1,'string','ON','enable','on','BackgroundColor','green');

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by