同步时闪烁的列表框 [英] Flickering ListBox When synchronizing

查看:100
本文介绍了同步时闪烁的列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

从服务器同步列表框(客户端)时出现问题.我使用了删除所有项目,并将从服务器添加新项目到导致闪烁的列表框中.同步间隔为500毫秒.我无法使用数据绑定,因为我的列表框是自定义的(图像支持)并且不支持数据绑定.我该如何解决这个问题?

Hi there,

I have a problem when syncronizing my listbox(client) from server. I use a delete all items and add new items from server to the listbox that cause flickering. Syncronization interval is 500milisecond. I can''t use databinding because my listbox is customized(image support) and doesnot support data binding. how can i fix this problem? is there any other way for synchronizing?

推荐答案

也许您可以在更新ListBox之前调用列表框SuspendLayout,然后调用ResumeLayout?
另一件事可能不会完全清除列表框,而是在后台确定已更改,删除和添加了哪些项目,并尽可能少地更新列表框本身,以避免闪烁.

祝你好运!
Maybe you could call the listbox SuspendLayout before, and ResumeLayout after updating the ListBox?
Another thing that could help is not to fully clear the listbox but determine on the background which items have changed, deleted and added and update the listbox itself as less as possible to avoid the flickering.

Good luck!


这篇关于同步时闪烁的列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆