2

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?

svick
  • 236,525
  • 50
  • 385
  • 514
Rashi Anand
  • 71
  • 1
  • 7

2 Answers2

6

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

Julien
  • 3,509
  • 20
  • 35
  • I agree, if I u use a pop-up grid in my xaml, how do I collapse it after 3 seconds? – Rashi Anand Mar 13 '12 at 21:36
  • @RashiAnand You could use a timer to achieve that. Set a timer to time out after three seconds, and hook up some code to collapse the popup to the Tick, or whatever event the timer has. Then, when you open the popup, activate the timer. – Tom Lint Nov 05 '12 at 14:45
  • also see http://stackoverflow.com/questions/14522540/close-a-messagebox-after-several-seconds/ – George Birbilis Sep 02 '15 at 14:02
3

If your message box doesn't need a user action, use Toast Prompt from Coding4Fun toolkit.

http://coding4fun.codeplex.com/

Nirmit Kavaiya
  • 183
  • 1
  • 8