views:

149

answers:

3

Hi I have C# form which provided with button and picturebox

this button have main job which is (open dialog to choose file) after that this file will be copy to specific folder

if this file was huge I need my form display progress bar and increase until file copied "How I can do that"

+1  A: 

you can use BackgroundWorker for that. There are plenty of samples that show just what you want to do.

Krzysztof Koźmic
I've used this one from time to time, hopefully this can be of some assistance http://dotnetperls.com/backgroundworker
jlech
+3  A: 

See the System.Windows.Forms.ProgressBar class, and its associated example in the documentation. You'll likely end up using the BackgroundWorker component for this too. Here's an article with example usage.

Jonas
+1  A: 

ShFileOperation with FO_COPY and the FOF_SIMPLEPROGRESS flag.

You would need to use P/Invoke to do this.

Jerry Coffin
I'm guessing the OP doesn't know how to use P/Invoke.
JeffH
Could be -- but worth learning...
Jerry Coffin
I've used this solution in the past, seems so much easier than rolling your own with the Background worker. Good resource here: http://www.pinvoke.net/default.aspx/shell32.SHFileOperation
Mark