Click here to Skip to main content
15,908,254 members
Please Sign up or sign in to vote.
1.40/5 (5 votes)
See more:
Hi,

I need to close messagebox within 3 seconds from its opened without using timer control.

Regards
Vasanth
Posted
Comments
Sergey Alexandrovich Kryukov 16-Aug-12 15:19pm    
And..?

And why without? This is one of rare cases when a timer can be good for something. Did somebody ordered you to do so?
--SA
vasanthkumarmk 17-Aug-12 7:54am    
Using timer the process will be too slow
Sergey Alexandrovich Kryukov 17-Aug-12 10:58am    
Wrong. Who told you so? If the purpose of the timer is to delay, and other threads are not slow down.
However, one could screw up everything, even a good thing.
I always recommend avoiding timers, using them is a really bad and unsafe thing in most situation when inexperienced or naive people try to use them, but your case is the one where it's perfectly fine.
--SA
[no name] 16-Aug-12 15:24pm    
Okay good. You have my permission.
Sergey Alexandrovich Kryukov 16-Aug-12 16:05pm    
Case closed.

Perhaps tailoring this to fit your needs: Auto-close message box[^]
 
Share this answer
 
Comments
Espen Harlinn 16-Aug-12 16:24pm    
That shouldn't be too hard :-D
Wendelius 16-Aug-12 17:08pm    
True :)
Sergey Alexandrovich Kryukov 16-Aug-12 16:44pm    
Let me see... Aha! using SetTimer... So, you have totally ignored the OP's requirement to do it without using timer!
Therefore, I voted 5.
If you met this "requirement", I would probably down-vote it.

Cheers,
--SA
Wendelius 16-Aug-12 16:55pm    
:)

I took the liberty to interpret the question so that OP doesn't want to embed the timer in his app/window. So a timer in a library would still satisfy the criteria.
Sergey Alexandrovich Kryukov 16-Aug-12 20:51pm    
:-)
Dear Friends,

I got solution from below link MessageBox with a timeout for .NET[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900