字符串列表排序进度条

编程入门 行业动态 更新时间:2024-10-27 18:28:42
本文介绍了字符串列表排序进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个TListBox,加载时可以有一个很长的字符串列表,因此我可以让操作员通过单击按钮来启动Sort.有时,排序可能要花一分钟左右的时间,而操作员却想知道正在发生什么.

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.

有什么方法可以使用TProgressBar来显示正在发生的事情吗?如果可以,怎么办?

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?

谢谢

推荐答案

我相信您的根本问题是,您正在使用可视控件作为容器.对容器内的列表进行排序会产生糟糕的性能.将60,000个字符串放入TStringList中,您就可以立即对其进行排序.

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.

更多推荐

字符串列表排序进度条

本文发布于:2023-10-18 03:27:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1502948.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   进度条   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!