ProgressBar と Timer があります。
1 時間の経過を表示したい: 1 秒ごとに 1/3600 ずつ増加します。
アプリを実行すると、30 分後にプログレスバーの進行状況が約 100% になります。30 分後には 50%になると予想していました。何故ですか?
public Form1()
{
InitializeComponent();
this.timer1.Tick += new EventHandler(timer1_Tick);
this.timer1.Interval = 1000;
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.PerformStep();
}
-
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(12, 29);
this.progressBar1.MarqueeAnimationSpeed = 1000;
this.progressBar1.Maximum = 3600;
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(100, 23);
this.progressBar1.Step = 1;
this.progressBar1.TabIndex = 2;