messagebox

7 次查看(过去 30 天)
mohd
mohd 2012-5-3
评论: Asal Barak 2013-12-12
hi there, how to close all the messagebox automatically using matlab code.
  1 个评论
Jan
Jan 2012-5-3
What does "automatically" mean? After a certain period of time? Would closing all figure windows solve your problem, or do you need to keep all non-messagebox figures open?

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2012-5-3
This seemed to work for me
h=msgbox('Click OK');
close(h);
You can put the close() in a timer callback if you want to close it after a certain time. But check that h exists (see the FAQ for methods). http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

更多回答(2 个)

Ilham Hardy
Ilham Hardy 2012-5-3

Asal Barak
Asal Barak 2013-12-10
h=msgbox('Are you sure you want to delete this file?'); pause(2) close(h)
After 2 seconds your box will be closed. You can change the time to whatever you are intending to.
  2 个评论
Image Analyst
Image Analyst 2013-12-10
Unlike using a timer, this pause method will lock up the program during that time so the user will not be able to interact with anything else. It will not even continue if the user clicks OK immediately - it will still have to wait for the pause to finish.
Asal Barak
Asal Barak 2013-12-12
Thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by