【发布时间】:2015-01-01 19:55:55
【问题描述】:
WPF 中的文本选择(文本框等)看起来与其他 UI 工具包的不同,因为 WPF 在其选择矩形的文本上使用半透明覆盖。
SystemColors class 提供用于HighlightColor property 中该矩形的颜色(以及与之相关的其他属性)。但是,该颜色是完全不透明的。因此,颜色必须用作降低的不透明度。
TextBoxBase.SelectionOpacity、PasswordBox.SelectionOpacity 和 FlowDocumentPageViewer.SelectionOpacity 上的文档页面建议:
默认为 0.4。
另一方面,this blogpost 说:
SelectionOpacity (...) 默认值为 .6。
无论该默认值是什么,有没有办法从环境中检索与SystemColors.HighlightColor 一起使用的选择不透明度,而不是硬编码任意值(这甚至可能不是最好的非标准高亮颜色的选择)?
【问题讨论】:
-
投反对票的原因是什么?
标签: wpf systemcolors