unable to update progress bar with threading in C#

前端 未结 3 920
一生所求
一生所求 2021-01-23 15:44
    private void button1_Click(object sender, EventArgs e)
    {
        PROGRESS_BAR.Minimum = 0;
        PROGRESS_BAR.Maximum = 100;
        PROGRESS_BAR.Value = 0;

          


        
3条回答
  •  太阳男子
    2021-01-23 16:10

    You cannot interact with UI elements from non-UI thread. You need to use code like

    this.BeginInvoke((Action)(() => PROGRESS_BAR.PerformStep()));
    

提交回复
热议问题