Keep Form.BackgroundImage visible in high contrast

2019-07-03 22:04发布

I have a .NET Winform with a background image, and testing just reported the BackgroundImage is hidden when display settings in Win7 are set to high contrast mode. I understand why MS does this by default, but I'm hoping there is a way to override this behavior without changing the layout of my form? I'd rather not move my click events and such to another image control that I add on top of the form to simulate a background (and then also have to move my transparent PNGs to be contained by that as well)... we are in late stage of testing, so the less changes the better.

The "background" really isn't a typical background, it has text and important content on it that should not be hidden EVER. Sure, you can -1 me for bad design, but hey, it seemed to work up until this minor issue ;)

1条回答
ら.Afraid
2楼-- · 2019-07-03 22:45

This is just a guess: Will it hide the image if you use a monochrome image? You can then check at runtime (System.Windows.Forms.SystemInformation.HighContrast for WinForms or System.Windows.SystemParameters.HighContrast for WPF) and set it to the appropriate image.

查看更多
登录 后发表回答