I am creating a Button and setting FlatStyle to System.
Because this mode does not normally support images, to display an image along with the text, the Button's own Text is set to "" and I am painting my own image and text on top by Graphics.FromHwnd and TextRenderer in WndProc, by capturing WM_PAINT and doing my own drawing after calling base.WndProc.
This works great, except for one problem: On Windows 7, highlighted buttons pulse slowly between gray and blue. I find this pulsing causes the button to occasionally flicker.
- I already use WS_EX_COMPOSITED.
- I have tried DoubleBuffered = true. It does not help.
- I have tried BufferedGraphics with WM_PRINTCLIENT, but this does not draw in the Aero style, so there is no pulsing at all.
Any ideas?