问题
I have a confirmation screen in my app where I tell the user that his item is saved succesfully. He can press OK and the messagebox will go, but if he does not, how can I make the messagebox disappear after 3 seconds if there is no response?
回答1:
According to MSDN, there is no way to close a messagebox without user action (no method provided for this action) http://msdn.microsoft.com/en-us/library/system.windows.messagebox_methods(v=vs.95).aspx
回答2:
If your message box doesn't need a user action, use Toast Prompt from Coding4Fun toolkit.
http://coding4fun.codeplex.com/
来源:https://stackoverflow.com/questions/9674122/how-to-make-a-messagebox-disappear-after-3-seconds