check if user pressed the button "OK" in msgbox

23 ビュー (過去 30 日間)
Valmir Sadiku
Valmir Sadiku 2015 年 11 月 3 日
回答済み: Valmir Sadiku 2015 年 11 月 3 日
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

採用された回答

Valmir Sadiku
Valmir Sadiku 2015 年 11 月 3 日
I solved it by using dialog and adding an callback to the button. Maybe not the simplest solution, but it is a solution which works for now :-) Anyway thank you TastyPastry!
bye

その他の回答 (1 件)

TastyPastry
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
  1 件のコメント
Valmir Sadiku
Valmir Sadiku 2015 年 11 月 3 日
Nice, but how can I remove this icon?

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

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by