德尔福颤动者
显示应用程序正在执行某些操作的最佳解决方案是什么?
我尝试显示进度指示器,但没有成功。
更新:-------------
进度条工作正常,但不是我想要的。
我想显示一个throbber,就像网络浏览器使用的那样,只要有东西正在更新它一直在转动。
光标也可以处于 crHourGlass 模式。
What is the best solution to show that the application is doing something?
I tried showing a progress indicator, but it did not work.
UPDATE: -------------
A progress bar works fine, but isn't what I want.
I want to show a throbber, like what Web browsers use, so as long as something is being updated it keeps turning.
Cursor can also be in crHourGlass mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
试试这个:
AnimateUnit
Unit1
图像
Try this:
AnimateUnit
Unit1
The Images
您可能正在主线程中运行耗时的任务。
一种选择是将其移动到后台线程,这将允许为您的消息队列提供服务。您需要对其进行维护才能使您的进度条以及任何 UI 正常工作。
You are probably running your time consuming task in the main thread.
One option is to move it to a background thread which will allow your message queue to be serviced. You need it to be serviced in order for your progress bar, and indeed any UI, to work.
更新问题的答案:
Answer to the updated question:
一个指标就OK了。更改后您必须调用
Application.ProcessMessages
。A indicator is OK. You have to call
Application.ProcessMessages
after changing it.“显示该应用程序正在执行某些操作的最佳解决方案是什么?” - 将鼠标光标设置为 crHourGlass?或者创建另一个表单/框架/等来提醒用户应用程序正在“做”某事,并且他需要等待。
"What is the best solution to show that that application is doing something?" - set mouse cursor to crHourGlass? or to create another form/frame/etc which attentions the user that the application is 'doing' something, and he needs to wait.
在冗长的任务中,您偶尔可以更新视觉指示器,例如进度条或其他任何东西。但是,您需要通过在提供反馈的控件上调用
Update
立即重新绘制更改。不要使用
Application.ProcessMessages
因为这会引入可能的重入问题。From your lengthy task, you can occasionally update a visual indicator, like a progress bar or anything else. However, you need to redraw the changes immediately by calling
Update
on the control that provides the feedback.Don't use
Application.ProcessMessages
as this will introduce possible reentrancy issues.