winfrom中进度条的使用

 

 

 

 

     private void button1_Click(object sender, EventArgs e)
        {
            int value = progressBar1.Value = progressBar1.Value - progressBar1.Step;
            if (value >= progressBar1.Minimum)
            {
                progressBar1.Value = value;
                label2.Text = value.ToString();
            }
            // label2.Text = progressBar1.Value.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            progressBar1.PerformStep();
            label2.Text = progressBar1.Value.ToString();
            if (label2.Text=="100")
            {
                MessageBox.Show("加载完成!!!");
            }
        }

 

posted @ 2020-02-22 10:17  猎人7号  阅读(138)  评论(0编辑  收藏  举报