Change button color and text after it is clicked

19 visualizaciones (últimos 30 días)
Raldi
Raldi el 6 de En. de 2012
Respondida: munib chauhan el 23 de Feb. de 2017
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?

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (2)

Sagar
Sagar el 4 de Jul. de 2013
But how to change the color of the text that gets printed onto the pushbutton when it is clicked ?
  1 comentario
Nikhil Magdum
Nikhil Magdum el 28 de Feb. de 2014
set(handles.pushbutton1,'string','running','ForegroundColor','red','enable','off');

Iniciar sesión para comentar.


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

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by