Close uialert - App designer
16 ビュー (過去 30 日間)
古いコメントを表示
In App designer I have a function called
DayButtonPushed(app, event)
With the following code:
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info');
When I press the OK it does not close the background window. Therefore, how can I close all upon pressing ok (image attached)?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/921949/image.jpeg)
0 件のコメント
回答 (1 件)
Walter Roberson
2022 年 3 月 10 日
Why create a uifigure() there? uialert() will create its own uifigure()
6 件のコメント
Simon Chan
2022 年 3 月 12 日
Add a CloseFcn may be a workaround if you don't want to use the uifigure anymore.
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info','CloseFcn',{@closefig,aFig});
function closefig(src,event,aFig)
delete(aFig)
end
参考
カテゴリ
Help Center および File Exchange で Develop uifigure-Based Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!