MATLAB App Designer: How can I hide few of my app components when i run the app?
97 次查看(过去 30 天)
显示 更早的评论
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
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';
4 个评论
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!!
Eddie Burdak
2021-1-14
if the group is in a container (eg Panel) - just turn the containers visibility on and off
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!