VirtualTreeView: properly handling selection changes

后端 未结 4 798
自闭症患者
自闭症患者 2021-02-02 01:26

This question will seem obvious to those who haven\'t encountered the problem themselves.

I need to handle selection changes in VTV. I have a flat list of nodes. I need

4条回答
  •  渐次进展
    2021-02-02 02:19

    Use a one-shot timer. When the timer fires, check whether the selection is different, update your display if it is, and disable the timer. Each time you receive a potential selection-changing event (which I think is always OnChange), reset the timer.

    This gives you a way of waiting for the event you really want and avoid flickering. The cost is a slightly delayed UI.

提交回复
热议问题