check if user pressed the button "OK" in msgbox
显示 更早的评论
I want to show some message to the user and then check if he proceed with pressing button or if he closed the dialogue. e.g.:
uiwait(msgbox('Please press OK.','something'))
if(user pressed button to continue)
%%do something
else
%%process aborted due the user action (he closed the msgbox)
end
Do you have any idea how to get this?
Thank you in advance!
Best regards,
goldenEyes
采纳的回答
更多回答(1 个)
TastyPastry
2015-11-3
Use questdlg instead.
h=questdlg('Please press OK','something','OK','OK');
switch h
case 'OK'
%'OK' code here
case ''
%abort code
otherwise
end
类别
在 帮助中心 和 File Exchange 中查找有关 App Building 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!