我该如何实现聊天列表 [英] How can I implement chat list

查看:140
本文介绍了我该如何实现聊天列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我正在使用C#Winforms构建一个XMPP聊天应用程序。

我需要一个显示用户头像的列表框,和状态图标和名称..

我可以使用哪个控件来实现它?

此外,如果存在状态,如何在不循环列表的情况下轻松更新状态改变??



谢谢

Hi friends,

I am building a XMPP chat application using C# Winforms.
I need a listbox which shows users avatar, and status icon and name..
Which control I can use to implement this ?
Also, How can I easily update the status without looping through the list when a presence status change ??

Thanks

推荐答案

你走在正确的轨道上。使用Treelist肯定是要走的路。阅读一些关于如何将图像添加到树状列表等的文章。



http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.imagelist.aspx [ ^ ]



您将不得不迭代通过树形图来更新状态。没有其他办法。或者将树状列表绑定到基础数据源并迭代它...例如行。除非您的聊天应用程序中有20.000个用户,否则它将足够快。
You were on the right track. Using Treelist is definately the way to go. Read some articles on how to add images to the treelist etc.

http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.imagelist.aspx[^]

You will have to iterate through the treelist to update statusses though. There is no other way. Or bind the treelist to an underlying datasource and iterate through that .. e.g Rows. Unless you have like 20.000 users in your chat application it will be fast enough.


这篇关于我该如何实现聊天列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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