How to prevent flickering in ListView when updating a single ListViewItem's text?

前端 未结 10 2229
囚心锁ツ
囚心锁ツ 2020-11-27 04:56

All I want is to update an ListViewItem\'s text whithout seeing any flickering.

This is my code for updating (called several times):

listView.BeginUp         


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 05:57

    If you only want to update the text, simply set the changed SubItem's text directly rather than updating the entire ListViewItem (you've not said how you're doing your updates).

    The override you show is equivalent to simply overriding OnPaintBackground, which would be a "more correct" managed way to do that task, and it's not going to help for a single item.

    If you still have problems, we'll need clarification on what you've actually tried.

提交回复
热议问题