此外,在0%时,应该有一个标签显示等待…,当进度条开始时,它应该转到工作…,当它完成时,它应该说完成!
解决方法 使用GetTickCount()和初始化变量:uses windows;var mseconds,starttime: integer;procedore TForm1.FormCreate()begin starttime := GetTickCount(); mseconds := 0; Timer1.Enabled := false; Label1.Caption := ''; Progressbar1.position := 0; Label1.Caption := 'Waiting...';end;procedure TForm1.button1Click(Sender: TObject);begin Progressbar1.Min := 0; Progressbar.Max := 100; Progressbar1.position := 0; timer1.Enabled := True; Label1.Caption := 'Working...'; end;procedure TForm1.Timer1Timer(Sender: TObject);begin mseconds := GetTickCount() - starttime; if mseconds < 5000 then Progressbar1.position := Trunc(mseconds / 50) else begin Progressbar1.position := 100; Label1.Caption := 'Done!'; Timer1.Enabled := false; end;end;总结
以上是内存溢出为你收集整理的德尔福进度条全部内容,希望文章能够帮你解决德尔福进度条所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)