Windows forms - inactive highlight color

最后都变了- 提交于 2019-12-10 20:53:59

问题


I have a ListView control with OwnerDraw = true.

  • Sometimes my control might not be focused, but have the items selected. Which color should I use to render the selection bar?

  • I couldn't find any guidelines for that, however, it seems that the ordinary ListView uses the SystemColors.Control color for that (see the picture).

  • Could I rely on that or would that be incorrect for some cases?


回答1:


SystemColors.Control is the correct color to use. Unfortunately there is not a predefined Color in SystemColors for an inactive item that makes it obvious, but it is reliable.

The only time you cannot rely on SystemColors is when a user makes explicit changes to the theme color settings in Windows. However, you should not care about that because its an explicit user choice, and you should not interfere with user choices.

As for guidelines, the Windows UX Guidelines do not explicitly state the appropriate color to use for inactive items, but it does stress choosing colors consistant with the operating system that provide good contrast and easy readability.

In applications that I'm not too worried about the look and feel for, I use default system colors, but if I am theming my own application (eg. to look like Visual Studio for example), I avoid system colors altogether and use web colors instead.

Hope this helped.



来源:https://stackoverflow.com/questions/10428710/windows-forms-inactive-highlight-color

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