Keep Form.BackgroundImage visible in high contrast mode

别等时光非礼了梦想. 提交于 2019-12-23 16:01:10

问题


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:


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.



来源:https://stackoverflow.com/questions/11110050/keep-form-backgroundimage-visible-in-high-contrast-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!