Adding Text when Button is Pushed on App Designer

Hello!
I was wondering if there was a way I could make text appear when a button is pushed in an app? For example, if there was a button labeled "Rules" it would show a text with the rules once it was pressed.
Thanks!

1 comentario

Mario Malic
Mario Malic el 28 de Nov. de 2020
Editada: Mario Malic el 28 de Nov. de 2020
Hi,
Yes, it's possible, here's an example code.
Use the state button to toggle the visibility of the Label. Add the ValueChangedFcn callback to the button.
function ButtonValueChanged(src, event)
if Button.Value
Label.Visible = on;
else
Label.Visible = off;
end
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Nov. de 2020

Editada:

el 28 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by