Wake me up in 500ms
Posted on 2006-07-09
I have a requirement that when a button is clicked, I should wait 500ms and than open a message box.
However, when i use the Thread.Sleep(500) method, the GUI get freezed.
So what I need is some sort of mechanism that I supply a callback function to be called after a certain amount of milliseconds.
I know I can use timers, but I don't want to add a timer to my class and activate it, just for that delay.
So is there a function like this: InvokeAfterDelay(Delegate callback, int milliseconds) ?