File Copy with Progress Bar

后端 未结 6 705
有刺的猬
有刺的猬 2020-11-27 02:58

I used this code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;

namespace Windo         


        
6条回答
  •  醉酒成梦
    2020-11-27 03:37

    you can use Dispatcher to update your ProgressBar .

    UpdateProgressBarDelegate updatePbDelegate = new UpdateProgressBarDelegate(ProgressBar1.SetValue);
    
    Dispatcher.Invoke(updatePbDelegate, System.Windows.Threading.DispatcherPriority.Background, new object[] { ProgressBar.ValueProperty, value });
    

提交回复
热议问题