visual c# form update results in flickering

前端 未结 10 1100
眼角桃花
眼角桃花 2020-12-17 21:18

I have a .net app that I\'ve written in c#. On some forms I frequent update the display fields. In some cases every field on the form (textboxes, labels, picturebox, etc) ha

10条回答
  •  感动是毒
    2020-12-17 21:44

    It could also be caused by your coding, not the absence of doublebuffering. I came here just now with a similar problem but realised it's because:

    1. I set a frame to invisible when an item is not selected.
    2. In between user selections, the index is cleared by the ListView control.
    3. I'm bound to the SelectedIndexChanged event

    In other words:

    • User clicks item 1
      ~ SelectedIndexChanged(1)
    • User clicks item 2
      ~ SelectedIndexChanged(-1) <---- This causes the flicker
      ~ SelectedIndexChanged(2)

    So what's the solution? How to avoid thousands of needless ListView.SelectedIndexChanged events?

提交回复
热议问题