I've got stuck with automatical closing of the MessageBox
after expiration of the timer. I use static
variable of type Timer
(not System.Windows.Forms.Timer
) which is defined in the special class
(definition of the class
is not static
).
Timer is calling with the help of the reference to name of the class because of static
keyword. My class
where this timer defined as static
called Helper
. So the calling I produce using next code
Helper.timer.Interval = 300000;
Helper.timer.Enable = true;
timer is the name of this variable
The task is to handle time when the MessageBox
appeared and after the time expiry, close this MessageBox
automatically if none of the buttons inside it weren't clicked. Is it possible to do this operation without using and defining AutoClosingMessageBox
class like I've seen in the simular questions?
I've got tried some of methods including checking whether user clicked some of the buttons of MessageBox
but it didn't give me a required result.
I would be grateful if someone could show me the realization :) If it's required I can fill up the question with the code template of my whole project. This all I need to create on the C# programming language.
Thanks in advance!