C# Form.TransparencyKey working different for different colors, why?

I’ve heard of this problem before but never realized it was related to the TransparencyKey choice. Nice find. It is almost certainly caused by Aero. With it disabled, the effect is implemented by use of a hardware overlay in the video adapter. With it enabled, the desktop window compositing feature implements it. You can typically tell by a very brief flash of the transparency color before DWM catches up and replaces the area with the pixels from the windows in the background. Turning DWM off for your window might fix the problem but you’ll also lose the glass effects.

I can see little rhyme or reason to the color value, looks pretty random to me. Hard to call this anything else than a bug. I never ran into this before myself, I always use the same transparency key. Color.Fuchsia, an excellent fuchsed-up color. Recommended.

Leave a Comment