I have found a flickering problem in the WinForms .NET TreeView while working with one of a legacy project in Windows 11. It turned out that the problem can be easily reproduced in a brand-new WinForms project for .NET Framework (I used the v4.7.2). First create a TreeView with two root nodes, each with a couple of subnodes. Then create an ImageList with the color depth set to 8, 16 or 24 bits and upload one 16x16 image to it. Finally, attach this ImageList to our TreeView and launch the project:
If we expand the root nodes and move the mouse pointer over the root tree line containing the plus/minus buttons, the nodes at the right of the mouse pointer start to flicker.
During my experiments I found that this problem occurs only in Windows 11 - all is ok in Windows 10. And the problem goes away if I set the ImageList color depth to 32 bit.
I tried to play with double buffering using answers for this question, but they didn't help. What it could be and how to eliminate this flickering effect?