views:

13101

answers:

6

I have a form showing progress messages as a fairly long process runs. It's a call to a web service so I can't really show a percentage complete figure on a progress bar meaningfully. (I don't particularly like the Marquee property of the progress bar)

I would like to show an animated GIF to give the process the feel of some activity (e.g. files flying from one computer to another like Windows copy process).

How do you do this?

+2  A: 

If you put it in a PictureBox control, it should just work

Grank
+19  A: 

It is not too hard.

  1. Drop a picturebox onto your form.
  2. Add the .gif file as the image in the picturebox
  3. Show the picturebox when you are loading.

Things to take into concideration:

  • Disabling the picturebox will prevent the gif from being animated.

Animated gifs:

If you are looking for animated gifs you can generate them here: ajaxload.info

Another way of doing it:

Another way that I have found that works quite well is the async dialog control that I found on the code project

FryHard
Embarrassingly easy! MY initial "Googling" didn't show this - maybe it is too obvious. Thanks.
Stuart Helwig
my initial "Googling" brought me straight to this page... :) fanx this took me less than a minute to learn...
Junaid Saeed
+2  A: 

Note that in Windows, you traditionally don't use animated Gifs, but little AVI animations: there is a Windows native control just to display them. There are even tools to convert animated Gifs to AVI (and vice-versa).

PhiLho
Yes - perhaps that's what I should've asked. Thanks.
Stuart Helwig
A: 

It doesn't when you start a long operation behind, because everything STOPS since you'Re in the same thread.

A: 

add Application.DoEvents

A: 

does not work in WinCE ... neither with adding Application.DoEvents()

... just aint movin

Elqila