[.net] file progress popup?

Started by
3 comments, last by Codeka 14 years, 5 months ago
I'm looking for a simple way to have a file progress window pop up. One of the kind where it shows a file flying from one file to another or something like that. The idea is that I have a function that is going to take some time to execute because it has to access a sql database and run a few querys on that at the beginning of the function i'd like to be able to pop up a progress window that animates, showing that something is going on. and then at the end of the function when it's all done i would like to close the dialog thanks in advance!
Advertisement
Just show a modal dialog with an animated gif on it. I believe the "file copying" gif is included in the vs2008 image library, so just add that to your project and set the correct property on a picture box

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
Long-running operations should be performed on a background thread, not the main UI thread. That way, you can pop up a "progress" dialog with whatever animation you like, and the main thread doesn't lock up waiting for the long operation to complete.

Those animations are all included with Visual Studio (at least they're in the professional edition, I'm not sure about express) but from what I can see, it's only got the Windows 95-themed ones, none of the newer Windows XP or Windows Vista themed ones are there.

However, better than doing the dialog and animation and all that yourself, would be to use the IProgressDialog interface exposed by the windows shell. It'll be themed with whatever version of windows you're running on (though on Vista and later, it doesn't use the animation you provide and instead just uses the generic "built-in" one).
where are all of these animations? I have VS2008 Pro so I should have them but I don't see them anywhere.

Thanks.
They're in a zip file inside Common7\VS2008ImageLibrary on my installation of Visual Studio, that corresponds to:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary

Just unzip the file in there and they should all be there.

This topic is closed to new replies.

Advertisement