MATLAB Answers


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

Jasraj Soni さんによって質問されました 2019 年 10 月 25 日
最新アクティビティ Kojiro Saito
さんによって コメントされました 2019 年 10 月 25 日
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 件のコメント

サインイン to comment.


1 件の回答

回答者: Kojiro Saito
2019 年 10 月 25 日
編集済み: Kojiro Saito
2019 年 10 月 25 日

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
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';

  2 件のコメント

Jasraj Soni 2019 年 10 月 25 日
Thank you so much! Its working now.
Appreciate your time and help.

サインイン to comment.

Translated by