小弟新手第一次接触到进度条控件progressBar,有高手指点下怎么用吗,听说要用到TIMER控件线程操作,但不知道具体该怎么弄,希望有段源代码看看...

解决方案 »

  1.   

    MSDN
      

  2.   

    public void createNewRecords()
    {
       // Sets the progress bar's Maximum property to
       // the total number of records to be created.
       progressBar1.Maximum = 20;   // Creates a new record in the dataset.
       // NOTE: The code below will not compile, it merely
       // illustrates how the progress bar would be used.
       CustomerRow anyRow = DatasetName.ExistingTable.NewRow();
       anyRow.FirstName = "Stephen";
       anyRow.LastName = "James";
       ExistingTable.Rows.Add(anyRow);   // Increases the value displayed by the progress bar.
       progressBar1.Value += 1;
       // Updates the label to show that a record was read.
       label1.Text = "Records Read = " + progressBar1.Value.ToString();
    }
      

  3.   

    直接设置它的Value值就行了,它自己知道改变
      

  4.   

     设置Maximum  、mininum(最大值、最小值)
     进度是由value 控制
     
     pb.value = 50 ;
      

  5.   

    Progressdownload.Value = 0
    Progressdownload.Maximum = 1000
    function bb
    {
      for(i=0;i<1000;i++)
    {
      Progressdownload.Value += 1
    }
    }
    启用一个新线程调用这个函数