Stringlist sort progress bar

谁都会走 提交于 2019-12-25 02:03:28

问题


I have a TListBox that can have a very long stringlist when loaded so I have the operator initiate a Sort by clicking a button. Sometimes the sort can take close to a minute and the operator is left wondering what's happening.

Is there any way I can use a TProgressBar to show that something is happening? If so, how?

OR

Can I Grey (visually disabled) the screen at the start and then color back to white when the sort is completed? If so, how?

Thanks


回答1:


I believe that your fundamental problem is that you are using a visual control as a container. Sorting the list inside the container will have terrible performance. Put 60,000 strings in a TStringList and you'll be able to sort them instantly.

Rather than holding the items in the visual control, you can operate it in virtual mode. That will be the most efficient way to operate.

If you make these changes then you won't need a progress bar.



来源:https://stackoverflow.com/questions/22287179/stringlist-sort-progress-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!