载入进度条
#region 窗体载入 /// <summary> /// 窗体载入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmHumitureData_Load(object sender, System.EventArgs e) { this.Text = "温湿度数据"; this.Controls.Add(progressBar); this.progressBar.Location = new System.Drawing.Point(300, 200); this.progressBar.Size = new System.Drawing.Size(400, 40); this.progressBar.Name = "progressBar"; this.progressBar.Properties.ShowTitle = true; //this.progressBar.BringToFront(); //this.progressBar.Properties.Maximum = 2000; //this.progressBar.EditValue = 50; } #endregion
设置进度条最大最小值
DateTime beginTime = Convert.ToDateTime(this.datBeginTime.EditValue); DateTime endTime = Convert.ToDateTime(this.datEndTime.EditValue); TimeSpan t = endTime - beginTime; this.progressBar.Properties.Maximum = ConvertHelper.TryToInt(t.TotalMinutes); this.progressBar.Properties.Minimum = 0;
更新进度条
this.progressBar.Position = j * 1440; this.progressBar.Refresh(); this.progressBar.Update();
时间: 2024-10-20 13:50:54