MATLAB Answers

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

54 ビュー (過去 30 日間)
Jasraj Soni
Jasraj Soni 2019 年 10 月 25 日
コメント済み: Parth Dethaliya 2020 年 5 月 13 日
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 件のコメント

サインインしてコメントする。

採用された回答

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

  3 件のコメント

Jasraj Soni
Jasraj Soni 2019 年 10 月 25 日
Thank you so much! Its working now.
Appreciate your time and help.
Parth Dethaliya
Parth Dethaliya 2020 年 5 月 13 日
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!!

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by