How to reproduce identical tab whenever button is clicked?
7 次查看(过去 30 天)
显示 更早的评论
I have created an app using AppDesigner Tool. I want to reproduce the tab shown in following figure in identical configuration whenever button is clicked. How can I achive this?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1338049/image.png)
1 个评论
chrisw23
2023-3-28
...one of x possibilities
Store each uiControl state on button click in private properties (structure of your choice) and compare with current settings on next click. Define your initial tab setting in the startup function.
采纳的回答
Simon Chan
2023-3-28
Set the Callback of Button pushed function as follows:
% Button pushed function: Button
function duplicateTab(app, event)
obj = allchild(app.Tab); % Find all childrens from the 1st tab
newtab = uitab(app.TabGroup,'Title',app.Tab.Title); % Create a new tab with the same title
copyobj(obj,newtab); % Copy all objects to the new tab
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!