MATLAB Answers

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

31 views (last 30 days)
Jasraj Soni
Jasraj Soni on 25 Oct 2019
Commented: Kojiro Saito on 25 Oct 2019
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.

  0 Comments

Sign in to comment.

Accepted Answer

Kojiro Saito
Kojiro Saito on 25 Oct 2019
Edited: Kojiro Saito on 25 Oct 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';

More Answers (0)

Sign in to answer this question.

Products


Translated by