C# How to refresh a listview

无人久伴 提交于 2020-03-20 22:49:45

问题


I've writtent the following code :

this.listView1.Items[i].BackColor = Color.Orange;

I would like to know how can I refresh my listview so I can see in real time the updated listview. Thanks.


回答1:


Normally you should not do anything special, and ListView will be redrawn itself when you're changing item's backcolor.

But anyway, you can use listView1.Refresh(); to force its redrawing.




回答2:


Try the following:

listView1.Items.Clear();


来源:https://stackoverflow.com/questions/30104779/c-sharp-how-to-refresh-a-listview

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