MATLAB App Designer: How can I hide few of my app components when i run the app?

97 visualizaciones (últimos 30 días)
I am trying to create an App where i want to hide some of the components intitially when I run the App. Could someone help me how to do it?
Your help would be highly appreciated. Thank you.

Respuesta aceptada

Kojiro Saito
Kojiro Saito el 25 de Oct. de 2019
Editada: Kojiro Saito el 25 de Oct. de 2019
For example, from Component Browser, select app.UIFigure and add StartupFcn callback.
Then in Code View, you can add startupFcn as the follows. You can make components invisible by changing Visible property of components.
function startupFcn(app)
app.Button.Visible = 'off'; % For button
app.UIAxes.Visible = 'off'; % For axes
end
Please replace app.Button or app.UIAxes to your existing components names.
And if you want to make them visible, change Visible properties to 'on'.
app.Button.Visible = 'on';
app.UIAxes.Visible = 'on';
  4 comentarios
Parth Dethaliya
Parth Dethaliya el 13 de Mayo de 2020
How can perform the same operation for a group? I mean i created group in design view now i wants to change visibility of the whole group!!
Eddie Burdak
Eddie Burdak el 14 de En. de 2021
if the group is in a container (eg Panel) - just turn the containers visibility on and off

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by