I was wondering if we could give the open source community this logic, using which the C# Windows Form App Developers can integrate the copy and move native window box like this -
Can we even do this? Because whatever threads I have came across while searching for this provide their own Progress Bar in Windows App.
What comes unnatural is that you have to add a reference to the assembly Microsoft.VisualBasic
in your C# project.
And then add the correct namespace at the top of your .cs file:
using Microsoft.VisualBasic.FileIO;
Here is the "C#" code (that really is nothing more the a call to the correct method) to invoke FileSystem.CopyDirectory
private void button1_Click(object sender, EventArgs e)
{
FileSystem.CopyDirectory(
@"c:\src",
@"c:\dst",
UIOption.AllDialogs,
UICancelOption.DoNothing);
}
And that will generate the desired eye candy for you with having to deal with any Progressbar handling on your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With