Windows copy animation

bjwade62

Well-known member
Joined
May 25, 2006
Messages
50
Programming Experience
3-5
Does anyone know how to use the Windows copy animation in .NET?

It was pretty easy in VB6. Just place an animation control on a from, set a couple properties and you're in business. What could be easier?

I can't find much information on the .NET way of doing it. Any help would be appreciated.
 
Those dialogues are built into VB 2005. Use the methods of the My.Computer.FileSystem object and it will display progress dialogues for you, as though you were drag and dropping in Windows Explorer.
 
If you are doing file operations, that is, those animations can be nice for other progress too, for example one could display flying papers when uploading documents to webserver.
 
Thanks for the reply. I'm still having problems with the dialogue box appearing. Here's what I'm using.

My.Computer.FileSystem.CopyFile("c:\0000\MyFile.txt", "c:\temp\MyFile.txt")

Those dialogues are built into VB 2005. Use the methods of the My.Computer.FileSystem object and it will display progress dialogues for you, as though you were drag and dropping in Windows Explorer.
 
That is because the default for ShowUI parameter is 'UIOption.OnlyErrorDialogs', which means you must specify UIoption if you want something else than only error dialogs. See documentation for that method.
 
You've been a great help but I'm still having problems getting it to work. I'm pretty new to VB.NET so I guess I need a little more detail. I've read the documentation you linked for me but am unable to apply it correctly. I hate to ask but can you give me a little more information on it's correct usage?

Thank You!

That is because the default for ShowUI parameter is 'UIOption.OnlyErrorDialogs', which means you must specify UIoption if you want something else than only error dialogs. See documentation for that method.
 
I think I got it.

I was trying - My.Computer.FileSystem.CopyFile("c:\0000\MyFile.txt", "c:\temp\MyFile.txt",true)

and - My.Computer.FileSystem.CopyFile("c:\0000\MyFile.txt", "c:\temp\MyFile.txt",showui)

This worked - My.Computer.FileSystem.CopyFile("c:\0000\MyFile.txt", "c:\temp\MyFile.txt" ,UIOption.AllDialogs)

Thanks Again






That is because the default for ShowUI parameter is 'UIOption.OnlyErrorDialogs', which means you must specify UIoption if you want something else than only error dialogs. See documentation for that method.
 
You can write fileio.uioption.AllDialogs as the third param. The easiest whenever you use methods that are overloaded with parameters that are enumerations is to jsut press comma key , and browse the method overloads in intellisense editor dialog and when you see (in this case) the one that uses uioption you press space key to give you dialog to choose between the valid enumeration members.
 
Hi John,
Well as I said, I did manage to get it working. It works great if the file already exists, I get the nice overwrite dialogue box. However, the copy progress dialogue doesn't seem to appear at all. Any Ideas?

Thanks again for all your help. I really appreciate it.
Bernie

You can write fileio.uioption.AllDialogs as the third param. The easiest whenever you use methods that are overloaded with parameters that are enumerations is to jsut press comma key , and browse the method overloads in intellisense editor dialog and when you see (in this case) the one that uses uioption you press space key to give you dialog to choose between the valid enumeration members.
 
If the operation takes less than 2 seconds the progress dialog won't appear. Copying a small text file shouldn't take more than a millisecond. For example even a 83MB file copy takes less than a second on my system.
 
Back
Top