Hi xuyunhai,
if you don't want to block your GUI thread by some lengthy calculation or just
Thread.Sleep()
in a method invoked by a
Timer.Tick
event, you will have to move that calculation/processing to a different thread. You can start out reading here (with simple examples):
Threading Tutorial C#[
^].
[Update]
Thanks for posting the code sample. The sad story is there is no way to do the DailyTask method on the GUI thread and not having to wait. Most probably you want it on the GUI thread to have easy access to the form's controls. If you need to access the form's controls from within a thread different from the GUI thread you can use the
Control.Invoke(...)
method:
Control.Invoke Method (Delegate)[
^].
[/Update]
Regards,
— Manfred