1

I have an application that takes quite long to save the data as it has to write over intranet. I want to run an animation showing that saving is in progress. How to do it? Any code examples?

Thanks Furqan

Furqan Sehgal
  • 4,917
  • 33
  • 108
  • 167

1 Answers1

1

Try to use Tasks:

Imports System.Threading.Tasks

...

Dim task As New Task(Save, Nothing)
task.ContinueWith(StopAnimation)
StartAnimation()
task.Start()

Where Save, StartAnimation and StopAnimation is your actions/methods.

oxilumin
  • 4,775
  • 2
  • 18
  • 25
  • It says .Tasks does not have any public member – Furqan Sehgal May 01 '11 at 11:56
  • There is no Task class in .net 3.5. You could use [Threads](http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(SYSTEM.THREADING.THREAD);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV3.5%22);k(DevLang-CSHARP)&rd=true") and [SynchronizationContext](http://stackoverflow.com/questions/457237/run-code-on-ui-thread-without-control-object-present") in this case. You also can use [BackgroundWorker](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx). – oxilumin May 01 '11 at 12:44